in the aspx page i am getting this error while binding dropdown list
Unable to cast object of type 'System.Web.Mvc.SelectList' to type 'System.Collections.Generic.IList`1[System.Web.Mvc.SelectListItem]'.
I have written:
<p>
<label for="categoryId">Category:</label>
<%= Html.DropDownList("categoryId", (IList<SelectListItem>)ViewData["categoryId"])%>
<%= Html.ValidationMessage("categoryId", "*")%>
</p>
please tell me the correct way of writing.
thanks
ritz