DropDownList, getting DataValueField returned in C#

前端 未结 3 1870
清酒与你
清酒与你 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 07:09

    You can use the SelectedValue property:

    // to set
    DropDownList3.SelectedValue = "1";
    
    // to read
    string value = DropDownList3.SelectedValue;
    

提交回复
热议问题