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   不知道怎么回事???

解决方案 »

  1.   

    刚才发过了阿
    this.DropDownList1.SelectedValue
      

  2.   

    this.DropDownList1.SelectedValue可以获取。始终为1,看看是不是因为Postback重新绑定了数据源
      

  3.   

    应该用this.DropDownList1.SelectedItem.ToString().Trim();
    我已经测试过了,可以的。
      

  4.   

    this.DropDownList1.DataSource= Purview.PurviewList("tableclass");        DataTable.PurviewList("tableclass");
                this.DropDownList1.DataTextField = "re";
    this.DropDownList1.DataValueField= "status";
    this.DropDownList1.DataBind(); 把你这句话,放到if(!IsPostBack) {} 里。
      

  5.   

    要把dropdownlist的ispostback属性设置为true
      

  6.   

    this.dropdownlist1.SelectItem.Value取值(.Text是文本)
      

  7.   

    我写了一篇关于这方面的简便方法在这里:http://www.zgbjp.com/bbs/bbs_detail.aspx?PostID=10151您参考以下!