Hi, I'm want to populate a dropdownlist with this year and the next 5 years.
So in the pageload I have added the code as shown in the snippet.
This I had hoped would give me the list 2008,2009,2010,2011,2012,2
013 but it actually only gives me a list of 2013 six times.
Can't quite work it out any help appreciated.
DateTime dt = DateTime.Now;
int year = dt.Year;
ListItem addYear = new ListItem();
for (int i = 0; i <= 5; i++)
addYear.Value = Convert.ToString(year + i);
addYear.Text = Convert.ToString(year + i);