I have issue how to populate the integer values like year list in Dropdown helper in MVC without using ViewBag , ViewData.
I try to find out the solution on StackOverflow. But I am facing the error when to load it.
Here my code :
Model:
public IEnumerable StudyYear
{
get
{
var YearsList = new List();
for (int year = 1950; year < 2016; year++)
{
YearsList.Add(year);
}
return YearsList;
}
}
Just need View Dropdown Code how todo it by view.
Midhun TpPosted Aug 6, 2016, 7:57 AM