dropdownlist error when dynamically genrated?
<p>I am creating a dropdownlist called"ddlYears" dynamically like below code
private void CreateDynamicDDL()<br>
        {<br>
            ddlYears.Items.Clear();
            ddlYears.Items.Add(new ListItem("Year","0")); 
            for (int k = 0; k &lt; 4; k++)<br>
            {<br>
                int time = int.Parse(DateTime.Now.Year.ToString());
                ddlYears.Items.Add(new ListItem((time-k).ToString(),(k+1).ToString()));<br>
            }
        }  </p>

<p>and i have ddl selectedindexchanged event as below</p>

<p>protected void ddlYears_SelectedIndexChanged(object sender, EventArgs e)<br>
        {<br>
            Response.Write(ddlYears.SelectedValue.ToString());
            Response.End();
        } </p>

<p>In the above code I am trying to write the selected value. But it's working fine, if select the second item which is "2010"((I mean returning selected value as 1)) and so on, but if I select first item which is "Year" it's not firing that "ddlYears_SelectedIndexChanged" event. Please somebody help me</p>

<p>Thanks</p>
