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;}
}

Jignesh KumarRank #91 · 22.9K reputationPosted Apr 25, 2020, 7:22 PM EDT
Schleid AlexRank #3,087 · 464 reputationPosted Apr 25, 2020, 7:42 PM EDT
Jefferson S. MottaRank #207 · 11.7K reputationPosted Apr 25, 2020, 6:16 PM EDT
Schleid AlexRank #3,087 · 464 reputationPosted Apr 25, 2020, 6:52 PM EDT
Schleid AlexRank #3,087 · 464 reputationPosted Apr 25, 2020, 7:02 PM EDT