I have the following code in the controller:
ViewBag.CategoryName = new SelectList(catList, "key", "value");
where catList is a Dictionary where key is of type string and value is of type string. This dictionary is populated properly and contains actual values (confirmed and tested).
In my view I have the following line of code:
@Html.DropDownListFor(model => model.CategoryName, (SelectList)ViewBag.CategoryName)
But when I run the page for some reason the actual value for the model's category name is not selected in the drop down list. Can anyone tell me what is the issue here? My model definitely has a category name and that name is in the list of values for the drop down list. The character's case is the same...