Reputation: 974
I have an update panel with UpdateMode set to conditional, and childrenastriggers set to false, but all the controls in the panel are performing async postbacks...
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdateProgress ID="pnlUpdateProgress" DisplayAfter="1" runat="server">
<ProgressTemplate>
Update in progress...
</ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel runat="server" ID="pnlUpdate" UpdateMode="Conditional" ChildrenAsTriggers="false">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnDoNothing" EventName="Click" />
</Triggers>
<ContentTemplate>
<div runat="server" clientidmode="Static" id="divList">
<asp:Button runat="server" ID="btnDoNothing" Text="Do nothing" OnClick="Unnamed_Click" />
<asp:Button runat="server" ID="btnSync" Text="Sync" OnClick="btnSync_Click" />
<br />
<div class="items_bought_table">
<table style="width: 100%; padding-bottom:24px;">
<thead>
<tr>
<th style="text-align: left;">Description</th>
<th></th>
</tr>
</thead>
<tbody>
<asp:Literal runat="server" ID="litList" />
</tbody>
</table>
</div>
<br />
<asp:Literal runat="server" ID="litDebugText" />
</div>
<div runat="server" clientidmode="Static" id="divEdit">
<asp:HiddenField runat="server" ID="txtEditID" />
<asp:Literal ID="litEditList" runat="server">
</asp:Literal>
<ul>
<li class="full_width pt_10">
Your Product: <em><asp:Literal runat="server" ID="litEditProductName" /></em>
</li>
</ul>
</div>
</ContentTemplate>
</asp:UpdatePanel>
Here both btnSync and btnDoNoting are performing async postbacks, where I would expect only btnDoNothing to post back async, btnSync should perform a full postback
Upvotes: 0
Views: 392
Reputation: 974
As @wazz stated in their answer, this is normal behavior in an update panel. To make a full back you need to make a "PostBackTrigger" as documented in the answer to this question.
<asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
<ContentTemplate>
...
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="myFullPostBackControlID" />
</Triggers>
</asp:UpdatePanel>
Upvotes: 0
Reputation: 5078
AsyncPostBackTrigger only sets controls that are outside of the panel.
Controls on the page outside of an update panel can refresh an UpdatePanel control by defining them as triggers. Triggers are defined by using the AsyncPostBackTrigger element.
Controls that postback will always postback. I think the ChildrenAsTriggers="false"
won't stop the postbacks - it will just stop the content from updating.
Upvotes: 1