Hello all,
I am trying to create a dynamic dropdownlist in asp.net.
using the following code
for (int i=DateTime.Now.Year-90;i<DateTime.Now.Year-15;i++)
{
li = new ListItem(i.ToString(),i.ToString());
drpDOByear.Items.Add(li);
}
However, I want to make it so that the value 1950 is the "selected" value. How do i do this dymamically?
Thanks for your help
I am trying to create a dynamic dropdownlist in asp.net.
using the following code
for (int i=DateTime.Now.Year-90;i<DateTime.Now.Year-15;i++)
{
li = new ListItem(i.ToString(),i.ToString());
drpDOByear.Items.Add(li);
}
However, I want to make it so that the value 1950 is the "selected" value. How do i do this dymamically?
Thanks for your help