Binding Dropdown list in MVC4+ASP.NET -
@html.dropdownlistfor(model => model._categoryid, new selectlist(viewbag.abc, "_categoryid", "_categoryname"), "select category")
this above code working fine binding dropdown list need understand it.....can elobrate it?
actually confused
model=>model._categoryid
why required? above line
its expression evaluates property want bind to, in case _categoryid
. html helper used generate html attributes used when posting back, in case <select name="_catagoryid" ... value="thevalueofcategoryid">
Comments
Post a Comment