当前位置: 代码迷 >> ASP.NET >> DropDownList1取值的有关问题
  详细解决方案

DropDownList1取值的有关问题

热度:3940   发布时间:2013-02-25 00:00:00.0
DropDownList1取值的问题
如何根据value获取Text值.

------解决方案--------------------------------------------------------
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write(DropDownList1.Items.FindByValue( "2 ").Text);
}
------解决方案--------------------------------------------------------
如果是这个意思 前面的加一句
DropDownList1.SelectedItem.Selected = false;
DropDownList1.Items.FindByValue( "1 ").Selected = true;