How to fill day, month and year dropdownlist asp.net and c#?
I have this code to fill the Month, Day and Year dropdownlist in asp.net and c#. How to fill day dropdown so that it will have appropriate days in the dropdown for selected month and year.
Currently day dropdown is not having the appropriate days for the selected month and year
DateTime month = Convert.ToDateTime("1/1/2000");
for (int i = 0; i < 12; i++)
DateTime NextMont = month.AddMonths(i);
ListItem list = new ListItem();
list.Text = NextMont.ToString("MMMM");
list.Value = NextMont.Month.ToString();
ddlMonth.Items.FindByValue((DateTime.Now.Month).ToString()).Selected = true;