Showing posts with label index. Show all posts
Showing posts with label index. Show all posts

Tuesday, December 4, 2012

Select DropDownList programmatically


Set by Text:
 DDL.SelectedIndex = DDL.Items.IndexOf(DDL.Items.FindByText("PassedValue"));
Set by Value: 
DDL.SelectedIndex = DDL.Items.IndexOf(DDL.Items.FindByValue("PassedValue"));