I am working on an Asp.NET project and I am trying to set the selected value of a dropdown list with a text property. For example i have i.e an item in the dropdown list wit
ListItem li=new ListItem();
li.Text="Stringxyz";
li.Value="Stringxyz"; // Create object of item first and find its index.
DropDownList1.SelectedIndex = DropDownList1.Items.IndexOf(li);