Follow by Email

Tuesday, 14 August 2012

Fill year in dropdownlist using for loop

Fill year in dropdownlist using for loop


private void fill_ExpDate_Y_dropdown()
{
for (int i = DateTime.Now.Year ; i <= DateTime.Now.Year + 20; i++)
{
ddl_ExpDate_Y.Items.Add(new ListItem(i.ToString(), i.ToString()));
}

ddl_ExpDate_Y.Items.Insert(0, "---Select---");
}

0 comments:

Post a Comment


                                                            

 
Design by Abhinav Ranjan Sinha