Hi,
I am trying to get a list of month and I have try this
Public List<MonthToShow> ddlMonth
{
for(int i= 1; i < 13; i++)
{
List<MonthToShow> monthlist = new List<MonthToShow
{ new MonthToShow { MonthName = monthlist.Add(DateTimeFormatInfo.CurrentInfo.GetMonthName(i),
MonthValue = i}
}
return monthlist;
but it is not working... this is to create a dropdownlist.
Thank you!
PS I have class MonthToShow
{
public string MonthName {get; set;}
public int MonthValue {get; set;}
}