How to Search Through a C# DropDownList Programmatically

后端 未结 9 1191
一生所求
一生所求 2021-02-14 05:24

I am having a hard time figuring out how to code a series of \"if\" statements that search through different dropdownlists for a specific value entered in a textbox. I was able

9条回答
  •  悲&欢浪女
    2021-02-14 05:51

    I was trying to find item by text in dropdownlist. I used the code below, it works: )

    ListItem _lstitemTemp = new ListItem("Text To Find In Dropdownlist");
    if(_DropDownList.Items.Contains(_lstitemTemp))
    {
        dosomething();
    }
    

提交回复
热议问题