Reputation: 151
I am running one asp.net application where i have one master page and content page. In master page i am using update panel inside dropdownlist. Now when i am running application then when i change dropdownlist value then first content page postback event fired after that master page postback event fired.
Below is my master page update panel with dropdown:
<asp:UpdatePanel runat="server" ID="updLOB" UpdateMode="Conditional">
<ContentTemplate>
<asp:DropDownList ID="ddl1" runat="server" OnSelectedIndexChanged="ddl1_SelectedIndexChanged" AutoPostBack="true">
<asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
How do i avoid content page postback when dropdown list changed?
Upvotes: 0
Views: 775
Reputation: 26
<asp:UpdatePanel runat="server" ID="updLOB" UpdateMode="Conditional">
<ContentTemplate>
<asp:DropDownList ID="ddl1" runat="server"
OnSelectedIndexChanged="ddl1_SelectedIndexChanged" AutoPostBack="true">
<asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddl1"
EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
Upvotes: 1
Reputation: 3045
you need to setup trigger source for updatepanel like below
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddl1" EventName="SelectedIndexChanged" />
</Triggers>
.
This should be embedded inside <asp:updatepanel>
element
Upvotes: 0