你知道我可以轻松地将字符串数组的内容绑定到MVC Razor视图中的DropDownList吗?
public static string[] AgeRagne = new string[] { "Sun","Mon","Tues","Wed" };
更新:
下面的代码工作.
@Html.DropDownListFor( model => model.Filter.AgeRange,new SelectList(Extensions.AgeRange,Model.Filter.AgeRange),new { @class = "search-dropdown",name = "ageRange" } )