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
This Link might help you
public static void SelectText(this DropDownList bob, string text) { try { if (bob.SelectedIndex >= 0) bob.Items[bob.SelectedIndex].Selected = false; bob.Items.FindByText(text).Selected = true; } catch { throw new GenericDropDownListException("value", text); } }