Question:You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You create a Web form by using ASP.NET AJAX.
The Web form contains the following code fragment. (Line numbers are included for reference only.)
01 <div>
02 <asp:ScriptManager ID="sptMgr" runat="server" />
03 <asp:Button runat="server" ID="btnSubmit"
04 Text="Submit" Width="100px" />
05 </div>
06 <script type="text/javascript">
07 function assignButtonEvents(contextObject) {
09 }
11 function buttonClick(eventElement) {
13 return false;
14 }
15 </script>
The application invokes the assignButtonEvents Javascript function during page initialization. In the function, you plan to attach the buttonClick event handler to the Click event of the btnSubmit Button control.
You need to ensure that the following tasks are performed:
The contextObject object is passed as an event argument.
The ContextData property of the contextObject object is used to display a message box in the buttonClick function.
What should you do?
A Insert the following code segment at line 08.
$addHandlers($get('btnSubmit'), {click:buttonClick}, contextObject);
Insert the following code segment at line 12.
alert(this.ContextData);
B Insert the following code segment at line 08.
$addHandlers($get('btnSubmit'), {click:buttonClick}, contextObject);
Insert the following code segment at line 12.
alert(eventElement.ContextData);
C Insert the following code segment at line 08.
$addHandlers($get('btnSubmit'), {onclick:buttonClick}, contextObject);
Insert the following code segment at line 12.
alert(eventElement.ContextData);
D Insert the following code segment at line 08.
$addHandlers($get('btnSubmit'), {onclick:buttonClick}, contextObject);
Insert the following code segment at line 12.
alert(this.ContextData);