public void LoadDDLYears(DropDownList ddlYear)
{
for (int i = 30; i > -30; i--)
{
ddlYear.Items.Add(System.DateTime.Now.AddYears(i).Year.ToString());
}
ddlYear.SelectedValue = System.DateTime.Now.Year.ToString();
}
public void LoadMonth(DropDownList ddlMonth)
{
DateTimeFormatInfo dtfi = new DateTimeFormatInfo();
for (int month = 1; month < 13; month++)
{
ListItem li = new ListItem();
li.Text = dtfi.GetMonthName(month);
li.Value = month.ToString();
ddlMonth.Items.Add(li);
}
}
Tuesday, June 9, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment