How to bind the selected value of a DropDownList

前端 未结 3 766

Data binding is all about declarative code, right? So I specify what I want with attributes, and the framework takes care of the rest. Unless I\'m mistaken and data bindin

3条回答
  •  执念已碎
    2020-12-15 05:27

    You might want to do something like the code below. You can not set the "SelectedValue" declaratively, but by saying "SelectedValue=<%# [code here] %> you are effectively causing the value to be set when the control is data bound.

    
    

提交回复
热议问题