Hi Guys,

I am trying to get populated the date in the dropdown list, and I wrote the code in c#

ie

private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
//DateTime currentDate = new DateTime();
//public string currentYear = currentDate.Year.ToString;
this.PopulateYear();
Response.Write(DateTime.Now.Year);
}



public void PopulateYear()
{
for(int i = 2000; i <= (DateTime.Now.Year)+ 5; i++)
{

if (i == DateTime.Now.Year)
{
ddlYear.SelectedItem.Selected = true;
}

ListItem item = new ListItem(i.ToString(),i.ToString());
ddlYear.Items.Add(item);
}
}



Here I am trying to display the current year as slected year. but I dunno for some reason it selected 2000 instead of 2004

please anyone help me to solve this...

Cheers,
dummy