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