c# - DropDownListfor in EditorTemplates -
am creating editortemplate boolean fields have yes no dropdown , below code
@model nullable<bool> @{ var listitems = new[] { new selectlistitem { value = "true", text = "yes" }, new selectlistitem { value = "false", text = "no" } }; } @html.dropdownlistfor( ????, listitems,"")
where want load drop-down selected item available in model can true or false
from view getting true or false in model property template. how can use dropdownfor accepts linq in 1st paramtere ?
thanks
you can either use
@html.dropdownlistfor(m => m, listitems, "")
or
@html.dropdownlist("", listitems, "")
Comments
Post a Comment