public void GetMonthList(DropDownList ddlMonthList)
{
DateTime month = Convert.ToDateTime("1/1/2000");
for (int i = 0; i < 12; i++)
{
DateTime NextMonth = month.AddMonths(i);
ListItem list = new ListItem();
list.Text = NextMonth .ToString("MMMM");
list.Value = NextMonth .Month.ToString();
ddlMonthList.Items.Add(list);
}
}
No comments:
Post a Comment