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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -