Question:You create a Microsoft ASP.NET Web application by using the Microsoft .NET Framework version 3.5.
You add the following code fragment to an AJAX-enabled Web form:
01 <asp:ScriptManager ID="scrMgr" runat="server" />
02 â–º<asp:UpdatePanel ID="updPanel" runat="server"
03 UpdateMode="Conditional">
04 <ContentTemplate>
05 <asp:Label ID="lblTime" runat="server" />
06 <asp:UpdatePanel ID="updInnerPanel"
07 â–º runat="server" UpdateMode="Conditional">
08 <ContentTemplate>
09 <asp:Timer ID="tmrTimer" runat="server"
10 Interval="1000"
11 OnTick="tmrTimer_Tick" />
12 </ContentTemplate>
13 â–º
14 </asp:UpdatePanel>
15 </ContentTemplate>
16 â–º
17 </asp:UpdatePanel>
The tmrTimer_Tick event handler sets the Text property of the lblTime Label control to the current time of the server.
You need to configure the appropriate UpdatePanel control to ensure that the lblTime Label Control is properly updated
by the tmrTimer Timer control.
What should you do?
A Set the UpdateMode="Always" attribute to the updInnerPanel UpdatePanel control in line 07.
B Set the ChildrenAsTriggers="false" attribute to the updPanel UpdatePanel control in line 02.
C Add the following code fragment to line 13:
<Triggers>
<asp:PostBackTrigger ControlID="tmrTimer" />
</Triggers>
D Add the following code fragment to line 16:
<Triggers>
<asp:AsyncPostBackTrigger ControlID="tmrTimer" EventName="Tick" />
</Triggers>