I setup the Controller to creaet a SelectList, like so:

NorthwindDataContext db = new NorthwindDataContext();  var categories = from c in db.Categories select c;  ViewData["CategoryID"] = new SelectList(categories, "CategoryID", "CategoryName");  

Then, in my View I rendered the DropDownList:

=Html.DropDownList("CategoryID",ViewData["CategoryID"])%>

This is very important if you are using Html.DropDownList in MVC

Posted via web from Ervin Ter’s posterous

Related posts:

  1. Macy – Thursday Special via macyhomefurnishings.com Prices on Thursday 12th November 2009 only Location:...
  2. C# Send New Post to Posterous Posterous has a set of API for developer to call...
  3. Microsoft Application Architecture Guide 2nd Edition from Patterns & Practices Microsoft Patterns & Practices released the 2nd edition of their...
  4. Two Improvement Needed For Posterous Robot Two Improvement Needed For Posterous Robot 1. Drag and Drop...
  5. My new keyboard and mouse Posted via email from Ervin Ter’s posterous...