You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create an AJAX-enabled Web form by using the following code fragment.
<asp:ScriptManager ID="scrMgr" runat="server" />
<asp:UpdatePanel runat="server" ID="updFirstPanel" UpdateMode="Conditional">
<ContentTemplate>
<asp:TextBox runat="server" ID="txtInfo" />
<asp:Button runat="server" ID="btnSubmit" Text="Submit" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server" ID="updSecondPanel" UpdateMode="Conditional">
<ContentTemplate> …
</ContentTemplate>
</asp:UpdatePanel>
When the updFirstPanel UpdatePanel control is updated, a dynamic client script is registered.
You write the following code segment in the code-behind file of the Web form. (Line numbers are included for reference only.)
01 Protected Sub Page_Load(sender As Object, e As EventArgs)
02 If IsPostBack Then
03
04 Dim generatedScript As String = ScriptGenerator.GenerateScript()
05
06 End If
07 End Sub
You need to ensure that the client-script code is registered only when an asynchronous postback is issued on the updFirstPanel UpdatePanel control.
Which code segment should you insert at line 05?
A.
ClientScript.RegisterClientScriptBlock(GetType(TextBox), "txtInfo_Script", generatedScript)
B.
ScriptManager.RegisterClientScriptBlock(Me, GetType(Page), "txtInfo_Script", generatedScript, False)
C.
ClientScript.RegisterClientScriptBlock(GetType(Page), "txtInfo_Script", generatedScript)
D.
ScriptManager.RegisterClientScriptBlock(txtInfo, GetType(TextBox), "txtInfo_Script", generatedScript, False)