Hi,
I am trying to get a list of month and I have try this
Public List ddlMonth
{
for(int i= 1; i < 13; i++)
{
List monthlist = new List
{ 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;}
}
5 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh KumarPosted Apr 25, 2020, 11:22 PM
Schleid AlexPosted Apr 25, 2020, 11:42 PM
Schleid AlexPosted Apr 25, 2020, 11:02 PM
Schleid AlexPosted Apr 25, 2020, 10:52 PM
Jefferson S. MottaPosted Apr 25, 2020, 10:16 PM