這是已知的行爲嗎?如果它是我如何使它工作?從第二UpdatePanel更新一個UpdatePanel
我有2個更新面板。每個人都有一個DropDownList控件,它在 之內。
我有1個按鈕,設置(綁定)第一個DropDownList。這 工程。
當我更改第1個DropDownList時,它應該更新第2個 DropDownList。
出於某種原因,第二個下拉列表永遠不會更新。
這裏是僞 - 代碼:
1日更新面板&的DropDownList:
<asp:Button ID="btnSet" runat="server"></asp:Button>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:DropDownList ID="DropDownList1" runat="server"
onselectedindexchanged="DropDownList1_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnSet" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<asp:DropDownList ID="DropDownList2" runat="server"></asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="DropDownList1" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
代碼背後:
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
BindSecondDropDownList();
}
幫助我這一個。
這就是我最後要做的。 – 2013-05-14 20:30:41
有一點幫助,將不勝感激。謝謝。 http://stackoverflow.com/questions/30352866/how-to-prevent-full-page-postback-on-selectedindexchange-for-dropdownlist – SearchForKnowledge 2015-05-20 15:07:31