What should you do to ensure that the requirements shown in the following table are met?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework
version 3.5.You write the following code fragment. (Line numbers are included for reference
only.)
01 <asp:UpdatePanel ID=”upnData” runat=”server”
02 ChildrenAsTriggers=”false” UpdateMode=”Conditional”>
03 <Triggers>
04
05 </Triggers>
06 <ContentTemplate>
07 <!– more content here –>
08 <asp:LinkButton ID=”lbkLoad” runat=”server” Text=”Load”
09 onclick=”lbkLoad_Click” />
10 <asp:Button ID=”btnSubmit” runat=”server” Text=”Submit”
11 Width=”150px” onclick=”btnSubmit_Click” />
12 </ContentTemplate>
13 </asp:UpdatePanel>
14 <asp:Button ID=”btnUpdate” runat=”server” Text=”Update”
15 Width=”150px” onclick=”btnUpdate_Click” />
You need to ensure that the requirements shown in the following table are met. What should you do?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework
version 3.5.You write the following code fragment. (Line numbers are included for reference
only.)
01 <asp:UpdatePanel ID=”upnData” runat=”server”
02 ChildrenAsTriggers=”false” UpdateMode=”Conditional”>
03 <Triggers>
04
05 </Triggers>
06 <ContentTemplate>
07 <!– more content here –>
08 <asp:LinkButton ID=”lbkLoad” runat=”server” Text=”Load”
09 onclick=”lbkLoad_Click” />
10 <asp:Button ID=”btnSubmit” runat=”server” Text=”Submit”
11 Width=”150px” onclick=”btnSubmit_Click” />
12 </ContentTemplate>
13 </asp:UpdatePanel>
14 <asp:Button ID=”btnUpdate” runat=”server” Text=”Update”
15 Width=”150px” onclick=”btnUpdate_Click” />
You need to ensure that the requirements shown in the following table are met. What should you do?

A.
Set the value of the ChildrenAsTriggers property in line 02 to false. Add the following
code fragment at line 04.
<asp:AsyncPostBackTrigger ControlID=”btnUpdate” />
<asp:PostBackTrigger ControlID=”btnSubmit” />

B.
Set the value of the ChildrenAsTriggers property in line 02 to false. Add the following
code fragment at line 04.
<asp:AsyncPostBackTrigger ControlID=”btnSubmit” />
<asp:PostBackTrigger ControlID=”btnUpdate” />

C.
Set the value of the ChildrenAsTriggers property in line 02 to true. Add the following
code fragment at line 04.
<asp:AsyncPostBackTrigger ControlID=”btnSubmit” />
<asp:PostBackTrigger ControlID=”btnUpdate” />

D.
Set the value of the ChildrenAsTriggers property in line 02 to true. Add the following
code fragment at line 04.
<asp:AsyncPostBackTrigger ControlID=”btnUpdate” />
<asp:PostBackTrigger ControlID=”btnSubmit” />

Explanation:
Set the ChildrenAsTriggers property to true if you want postbacks from immediate child controls of the UpdatePanel control to cause an update of the panel’s content. Child controls of nested UpdatePanel controls will not cause an update of the parent UpdatePanel control’s content unless you call the Update method explicitly or you define the child controls as triggers.

http://msdn.microsoft.com/en-us/library/system.web.ui.updatepanel.childrenastriggers.aspx

If you set the UpdateMode to the Conditional value, by default nested UpdatePanel controls will not cause an update to their parent.
You can change this behavior by setting the outer UpdatePanel control’s ChildrenAsTriggers property to True. In this case,
any updates triggered by the nested UpdatePanel will also trigger an update to the parent UpdatePanel. (MCTS Self-Paced Training Kit (Exam 70-562): Microsoft.Net Framework 3.5-ASP.Net Application Development (pg. 304)



Leave a Reply 0

Your email address will not be published. Required fields are marked *