dropdwonlist问题
程序如下:
ublic partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
DropDownList1.DataSourceID = "sqldatasource1";
DropDownList1.DataTextField = "xm";
DropDownList1.DataValueField = "xm";
DropDownList1.DataBind();
}
protected void Button1_Click(object sender, EventArgs e)
{
TextBox1.Text = DropDownList1.SelectedValue.ToString();
}
}
为什么每次TextBox1.Text的值都是DropDownList1的第一值,如何解决?AutoPostBack值是ture还是false?