在线等,两个DropDownList联动,二级DropDownList在模板中有自己的事件
在线等,两个DropDownList联动,二级DropDownList在模板中,有自己的事件,我想点击第一个DropDownList时候改变第二个DropDownList的值,然后第二个DropDownList触发自己的事件
这是第一个
<asp:dropdownlist id="ddl_AllAction" runat="server" AutoPostBack="True"> protected void ChangeAllAction(object sender, System.EventArgs e) { for(int i = 0; i < dg1.Items.Count; i++) { DropDownList ddl_action =(DropDownList)dg1.Items[i].FindControl("ddl_action"); ddl_action.SelectedIndexChanged += new System.EventHandler(this.ChangeAction); ddl_action.AutoPostBack = true; ddl_action.SelectedIndex = ddl_AllAction.SelectedIndex; } }<ItemTemplate><asp:DropDownList id="ddl_action" runat="server" Width="100%" OnSelectedIndexChanged="ChangeAction" AutoPostBack="True"></asp:DropDownList></ItemTemplate>