帮我看看这个dropdownlist错在哪里?
hottm 2006-02-23 10:20:22 protected System.Web.UI.WebControls.TextBox txtId;
protected System.Web.UI.WebControls.TextBox txtName;
protected System.Web.UI.WebControls.DropDownList Dlist;
protected System.Web.UI.WebControls.Button btnOK;
private void Page_Load(object sender, System.EventArgs e)
{
if(!IsPostBack)
{
DroplistDataBind();
}
}
private void DroplistDataBind()
{
//省略....
}
private void btnOK_Click(object sender, System.EventArgs e)
{
string Idno = "";
string Iname = "";
string Ixm = "";
Iname = txtName.Text.Trim();
Idno = txtId.Text.Trim();
lxm=Dlist.SelectedValue.Trim();
Response.Redirect("abcde.aspx?Cxm="+Ixm+"&Cno="+Idno+"&Cname="+Iname);
}
private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e)
{
}
运行时Dlist绑定正常, 当上面这个button点击后Idno和Iname读取都正常.但lxm老是空的,取不到Dlist中选定的值,怎么回事?