ASP.NET MVC 3 DropDownList help

Izi

Izi

Soldato
Joined
9 Dec 2007
Posts
2,718
T9kwE.png


Above is my model - I have created a select list (Categories) - how do I now display this select list in the view?

I am just starting out in MVC, but I can't believe I can't get this to work! :)
 
hmm <%= Html.DropDownList("ElementName", Model.Categories) %> this wasn't working until i changed the return type of SelectList to List<SelectListItem>

Anyway, got it working thanks for your help.

I am using Razor syntax and working without intellisense which didn't help.
 
Back
Top Bottom