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 -

python - Django-cities exits with "killed" -

python - How to get a widget position inside it's layout in Kivy? -