html - How to select an option in dropdown list htmlhelper -
i have enum this.
public enum weekday { monday, tuesday, wednesday, thursday, friday, saturday, sunday }
and i'm using in htmlhelper
@html.dropdownlistfor(model => model.day, new selectlist(enum.getvalues(typeof(weekday))), "select day", new { @class = "form-control" })
how can make dropdown list select 1 of days instead of showing "select day"?
try
@html.dropdownlistfor(model => model.day, new selectlist(enum.getvalues(typeof(weekday))), null, new { @class = "form-control" })
this result in selecting first entry in list. in case monday
Comments
Post a Comment