我用的vs.net好像有个bug。
在页面上有三个控件(WebForm1.aspx)
1,DropDownList1
2, Button1
3, TextBox1
资源:
在DropDownList的Items属性添加3条数据,样子是这样的:(在ListItem Collection Editor对话框中)
Members Properties
0 1 Text 1,Value 1
1 2 Text 2,Value 1
2 3 Text 3,Value 1
代码:(在WebForm1.aspx.cs中)
private void Button1_Click(object sender, System.EventArgs e)
{
TextBox1.Text = DropDownList1.SelectedItem.Text;
}
以上是不是很简单,但是如果在TextBox1中的值总是1的话,就说明你用的版本和我一样,如果不是请回复说明你用的版本号。
如果不是bug,就说明MS用Value值来判断你选的是哪条记录