I am trying to fill the dropdownlist from the database,
I am following this link
I have written the following code in the model
public class FillDeptName
{
public IList<SelectListItem> Drp_Name { get; set; }
}
I am getting the following error message:
The type or namespace name 'SelectListItem' could not be found (are you missing a using directive or an assembly reference?)
You are missing on top of your code:
using System.Web.Mvc;
http://msdn.microsoft.com/en-us/library/system.web.mvc.selectlistitem(v=vs.118).aspx
Import this namespace
using System.Web.Mvc;
FOR MORE
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With