2PTTechnology

The platform that enables you to build rich, interactive communities
Welcome to 2PTTechnology Sign in | Join | Help
in Search

SelectedIndex for DropDownList in aspx

Last post 06-12-2007, 8:55 PM by pskobel. 0 replies.
Sort Posts: Previous Next
  •  06-12-2007, 8:55 PM 49

    SelectedIndex for DropDownList in aspx

    there are two ways selecting a item in a DropDownList

    1) 
    MyDropDownList.ClearSelection();
    MyDropDownList.Items.FindByText("Value").Selected = true;

    2)
    MyDropDownList.ClearSelection();
    MyDropDownList.SelectedIndex = MyDropDownList.Items.IndexOf(MyDropDownList.Items.FindByText("Value"));

View as RSS news feed in XML
Powered by Community Server (Personal Edition), by Telligent Systems