如果图两个下拉列表,简称A、B下拉列表吧,B列表已经可以根据A条件来联动绑定所有的项,但是B下拉列表变动时,却取不到对应的值,是怎么回事?如果在载入页面加!ispostback,
B下拉列表就能正常取对应的值,但是A列表再次变动了,B列表就无法绑定了。大家看看怎么解决。
html 页
DropDownList 1
/*
/asp:ListItem
/asp:ListItem
/asp:ListItem
/asp:ListItem
/asp:ListItem
/asp:ListItem
/asp:DropDownList
DropDownList 2
/asp:DropDownList
*/
DropDownList 2绑定DropDownList 1
OracleConnection oracon = new OracleConnection(con);
string strqx = "select * from qxtxry where qxdm='" + drlxq.SelectedValue + "'";
OracleDataAdapter odap = new OracleDataAdapter(strqx, oracon);
DataSet qxds = new DataSet();
oracon.Open();
odap.Fill(qxds);
drlssgzz.DataSource = qxds;
drlssgzz.DataTextField = "shbzgzz";\名称
drlssgzz.DataValueField = "shbzgzzbh";\值
drlssgzz.DataBind();
oracon.Close();
DropDownList 2正常联动绑定,但是选择不同的项时,值都是相同的是什么原因取不到对应的值?