Exam 70-562 : Microsoft .NET Framework 3.5, ASP.NET Application Development – 24

Question: You work as a Web Application Developer at Company.com. You make use of the C# as the programming language to create an ASP.NET Web application in the Microsoft .NET Framework 3.5. You want to add Visual Basic.NET code to the application. However, the Visual Basic.NET code cannot be converted to C#. You therefore decide to add the following to the Web.config file:

<compilation debug="false">
<codeSubDirectories>
<add directoryName="VBasic"/>
</codeSubDirectories>
</compilation> 

You receive an instruction from management to make sure that the Visual Basic.NET code can be used by the application and that it can be configured and compiled at run time. What should you do?

  1. You should consider creating a new Microsoft Windows Communication Foundation service project that makes use of Visual Basic.NET as the programming language. Then the Visual Basic.NET code functionality should be exposed through the WCF service. Thereafter a service reference should be added to the WCF service project in the application.
  2. You should consider creating at the root of the application a new folder named VBasic. Thereafter the Visual Basic.NET code file should be placed in the new folder.
  3. You should consider creating a new class library that makes use of Visual Basic.NET as the programming language. Then the Visual Basic.NET code file should be added to the class library. Thereafter a reference should be added to the class library in the application.
  4. You should consider creating inside the App_Code folder of the application a new folder named VBasic. Thereafter the Visual Basic.NET code file should be placed in the new folder.

Correct Answer: 4


Question: You work as a Web Application Developer. The previous developer created an AJAX enabled ASP.NET Web application that uses Microsoft .NET Framework 3.5. The application is configured to run on a Web server named Company-SR01. Your application contains a Web form with the following code: (The line numbers is included for reference purposes)
01 <asp:ScriptManager ID=”scMan1″ runat=”server” />
02 <asp:UpdatePanel ID=”updPan1″ runat=”server” UpdateMode=”Conditional”>
03 <ContentTemplate>
04 <asp:Label ID=”lbl1″ runat=”server” />
05 <asp:UpdatePanel ID=”updPan2″ runat=”server” UpdateMode=”Conditional”>
06 <ContentTemplate>
07 <asp:Timer ID=”ckTimer” runat=”server” Interval=”1000″ OnTick=”ckTimer_Tick” />
08 </ContentTemplate>
09
10 </asp:UpdatePanel>
11 </ContentTemplate>
12
13 </asp:UpdatePanel>
In the application the ckTimer_Tick event handler is used to set the Text property of the lbl1 Label control to the present time of Company-SR01. You receive an instruction from management to make sure that the lblTime Label control is updated properly by the ckTimer Timer control. You thus need to determine the correct UpdatePanel control that has to be configured. What should you do?

  1. Your best option would be to make sure that the UpdateMode=”Always” attribute is set to the updPan2 UpdatePanel control in line 05.
  2. Your best option would be to add the code below in line 12:
    <Triggers>
    <asp:AsyncPostBackTrigger ControlID=”ckTimer” EventName=”Tick” />
    </Triggers>
  3. Your best option would be to add the code below in line 09:
    <Triggers>
    <asp:PostBackTrigger ControlID=”ckTimer” />
    </Triggers>
  4. Your best option would be to make sure that the ChildrenAsTriggers=”false” attribute is set to the updPan1 UpdatePanel control in line 02.

Correct Answer: 2


Question: You work as an application developer at Company.com. The Company.com network contains an IIS 6.0 Web server named Company-SR08 that hosts a Microsoft ASP.NET Framework 1.0 application. You verify that none of the features of the application have been deprecated. You want to upgrade the application to run on ASP.NET Framework 3.5 without having to recompile the application. What should you do?

  1. You should consider having the System.Web section handler version number set in the machine.config file.
  2. You should consider having the ASP.NET runtime version set in IIS 6.0.
  3. You should consider having the requiredRuntime configuration element added to the Web.config file. Thereafter the version attribute should be set to v3.5.
  4. You should consider having the supportedRuntime configuration element added to the Web.config file. Thereafter the version attribute should be set to v3.5.

Correct Answer: 2


Question: You work as the senior developer at Company.com. You make use of Microsoft .NET Framework 3.5 to create an AJAX enabled ASP.NET application. Your application contains a Web form with the code below: (The line numbers is included for reference purposes)
01 <script type=”text/javascript”>
02
03 Sys.Application.add_init(initComponents);
04
05 function initComponents() {
06
07 }
08
09 </script>
10
11 <asp:ScriptManager ID=”ScMan1″
12 runat=”server” />
13 <asp:TextBox runat=”server” ID=”txtBox1″ />
You make use of the initComponents function to create and start a client behavior. This client behavior is named ckClient. You have to make sure that ckClient is attached to txtBox1. You should determine the appropriate code segment you need to add in line 6 to accomplish this. What should you identify?

  1. Your best option would be to insert Sys.Component.create(ckClient, $get(‘txtBox1’), null, null, null)
  2. Your best option would be to insert Sys.Component.create(ckClient, ‘txtBox1’, null, null, null)
  3. Your best option would be to insert $create(ckClient, null, null, null, $get(‘txtBox1’))
  4. Your best option would be to insert $create(ckClient, null, null, null, ‘txtBox1’)

Correct Answer: 3


Question: You work as a Web Developer at Company.com. Company.com makes use of Microsoft ASP.NET 3.5. You are in the process of creating a Web application. The event handler handles the AsyncPostBackError event of a ScriptManager control named CK_scripts/_scriptManager.

protected void OnError(object sender, AsyncPostBackErrorEventArgs e)
{
CK_scripts/_scriptManager.AsyncPostBackErrorMessage = "A system error has occurred";
} 

Management wants you to exhibit the value of the AsyncPostBackErrorMessage property in a browser alert window as soon as an unhandled exception occurs on the server during an asynchronous request. What should you do?

  1. You should consider using the code segment:
    Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(OnLoaded);
    function OnLoaded(sender, args)
    {
    var dataItems = args.get_dataItems();
    var errorMessage = dataItems[‘ AsyncPostBackErrorMessage’];
    if (errorMessage != null)
    {
    window.alert(errorMessage);
    }
    }
  2. You should consider using the code segment:
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(OnEndRequest);
    function OnEndRequest(sender, args)
    {
    if (args.get_err() != undefined && args.get_err().httpStatusCode == ‘500’)
    {
    var errorMessage = args.get_err().message;
    args.set_errorHandled(true);
    window.alert(errorMessage);
    }
    }
  3. You should consider using the code segment:
    Sys.WebForms.PageRequestManager.getInstance().add_pageLoading(OnLoading);
    function OnLoading(sender, args)
    {
    var dataItems = args.get_dataItems();
    var errorMessage = dataItems[‘CK_scripts/_scriptManager.AsyncPostBackErrorMessage’];
    if (errorMessage != null)
    {
    window.alert(errorMessage);
    }
    }
  4. You should consider using the code segment:
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(OnEndRequest);
    function OnEndRequest(sender, args)
    {
    if (args.get_err() != undefined && args.get_err().httpStatusCode == ‘500’)
    {
    var dataItems = args.get_dataItems();
    var errorMessage = dataItems[‘ AsyncPostBackErrorMessage’];
    args.set_errorHandled(true);
    window.alert(errorMessage);
    }
    }

Correct Answer: 2

Tagged . Bookmark the permalink.

Leave a Reply