Friday, December 15, 2006

ASP.NET DropDown -Selection

To change the selected index of a dropdown list already populated if Value or text is known

myDropDown.SelectedIndex = myDropDown.Items.IndexOf(myDropDown.items.findbytext(strCurrentState))

myDropDown.SelectedIndex = myDropDown.Items.IndexOf(myDropDown.items.findbyvalue(strCurrentState))

No comments: