<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>陕西</asp:ListItem>
<asp:ListItem>湖北</asp:ListItem>
<asp:ListItem>广西</asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="DropDownList2" runat="server">
<asp:ListItem>西安</asp:ListItem>
<asp:ListItem>武汉</asp:ListItem>
<asp:ListItem>南宁</asp:ListItem>
</asp:DropDownList>要实现的功能是:在DropDownList1选择 陕西就会在DropDownList2出现西安。
选湖北就武汉。类推。 帮帮忙啊,老大门,数据不 从数据库里面取。在DropDownList里面写好的。谢谢!~
<asp:ListItem>陕西</asp:ListItem>
<asp:ListItem>湖北</asp:ListItem>
<asp:ListItem>广西</asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="DropDownList2" runat="server">
<asp:ListItem>西安</asp:ListItem>
<asp:ListItem>武汉</asp:ListItem>
<asp:ListItem>南宁</asp:ListItem>
</asp:DropDownList>要实现的功能是:在DropDownList1选择 陕西就会在DropDownList2出现西安。
选湖北就武汉。类推。 帮帮忙啊,老大门,数据不 从数据库里面取。在DropDownList里面写好的。谢谢!~
this._BindDDl2();
void BindDDl2()
{
//根据dropdownlist1.selectdValue查找数据绑定到2上.
}
DropDownList1_SelectedIndexChanged事件中判断一下咯
如果选种的是陕西 你就让DropDownList2 选中西安 以此类推
注意的是你要AuToPostBack设置为True;