this.DropDownList1.DataSource= Purview.PurviewList("tableclass"); DataTable.PurviewList("tableclass");
this.DropDownList1.DataTextField = "re";
this.DropDownList1.DataValueField= "status";
this.DropDownList1.DataBind();
我这边绑定的DropDownList1 的 text value我怎么来获取选择了的text的value值? 我获取的始终是1 不知道怎么回事???
this.DropDownList1.DataTextField = "re";
this.DropDownList1.DataValueField= "status";
this.DropDownList1.DataBind();
我这边绑定的DropDownList1 的 text value我怎么来获取选择了的text的value值? 我获取的始终是1 不知道怎么回事???
this.DropDownList1.SelectedValue
我已经测试过了,可以的。
this.DropDownList1.DataTextField = "re";
this.DropDownList1.DataValueField= "status";
this.DropDownList1.DataBind(); 把你这句话,放到if(!IsPostBack) {} 里。