Wednesday, July 29, 2009

How to fill year in dropdown list

public static void FillYear(DropDownList cmb)
{
ListItem li;
for (int i = 1990; i <= DateTime.Now.Year; i++)
{
li = new ListItem(i.ToString(), i.ToString());
cmb.Items.Add(li);
}
}

1 comment: