mercredi 2 octobre 2019

Should I fill a dropdown list with YES/NO options from a database or do it directly with HTML?

What's the best way to fill a dropdown list with YES/NO options?

Do it directly into the HTML code like this?:

<select class="form-control">
  <option>Select your answer</option>
  <option>Yes</option>
  <option>No</option>
</select>

Or do it with a table from a database and insert it into html like this?:

@Html.DropDownList("cmbQuestion", binaryAnswer, "Select your answer", new { @class = "form-control" })

Edit: If I know the dropdownlist options probably won't change.




Aucun commentaire:

Enregistrer un commentaire