In my MVC 3 Razor app, I have a Model with an enum..
Model Example:
public class EmployeeModel
{
public enum Title
{
Accountant = 111,
Sales =
Here is the solution
public enum Months
{
January=1,
February=2,
March=3,
April =4,
May=5,
June=6
}
public ActionResult Index()
{
ViewBag.Months = (from Months m in Enum.GetValues(typeof(Months))
select new SelectListItem { Text = m.ToString(), Value = Convert.ToUInt16(m).ToString() });
return View();
}
Add ViewBag name in DropDownList :
<%=Html.DropDownList("Months") %>