DropDownList, getting DataValueField returned in C#

前端 未结 3 1869
清酒与你
清酒与你 2021-01-22 06:21

I have a drop down list that pulls data from a database to show some of its options:

    

        
相关标签:
3条回答
  • 2021-01-22 06:50

    try this

    String taskID = DropDownList3.SelectedItem.Value;
    
    0 讨论(0)
  • 2021-01-22 06:57

    any way you can use either

    dropdown3.selectedvalue
    

    or

    dropdown3.selecteditem.value
    
    0 讨论(0)
  • 2021-01-22 07:09

    You can use the SelectedValue property:

    // to set
    DropDownList3.SelectedValue = "1";
    
    // to read
    string value = DropDownList3.SelectedValue;
    
    0 讨论(0)
提交回复
热议问题