asp:DropDownList取值问题:比如asp:DropDownList里有10行数据,用户选择了第三行,我如何获取该行的值??c#代码如何写?3Q各位

解决方案 »

  1.   

    SelectedIndex  
     SelectedItem  
     SelectedValue 
      

  2.   

    SelectedIndex //选择的索引
     SelectedItem  //选择的项
     SelectedValue  //选择的值
    SelectedText //选择的显示的文本
      

  3.   


          string  _value = DropDownList1.SelectValue;       //获取选中行的值
      

  4.   


    string DDLValue=DropDownList.SelectedValue;//选中的值
    string DDLText=DropDownList.SelectedItem.Text;//选中的文本
      

  5.   

    SelectedIndex //选择的索引
    SelectedItem //选择的项
    SelectedValue //选择的值这些东西太基础了
      

  6.   

    你先把ddl和数据库绑定。。记得有一个SelectedIndex   还有个SelectedValue
    到时候就可以选取获得了 
      

  7.   

    麻烦回去试试,不行就别说太基础.
    DropDownList1.Item[DropDownList1.SelectedIndex].ToString();