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

Question: You work as an application developer at Company.com. You make use of Microsoft .NET Framework 3.5 to create a Microsoft ASP.NET application. You application contains a single master page with a static navigation menu. All content pages reference the master pag

  • You want the content pages to replace the static navigation menu with their own navigation menu if one is require
  • What should you do?
    1. Your best option would be to add the following to the content page:
      <asp:Content PlaceHolderID=”menuHolder”>
      <asp:menu ID=”menuCtrl” runat=”server”> </
      asp: menu>
      </asp:Content>
    2. Your best option would be to add the following to the Page_Load event of the content page:
      Dim pHolder As ContentPlaceHolder = _
      TryCast(Page.Master.FindControl(“menuHolder “), ContentPlaceHolder)
      Dim menuCtrl As New Menu()
      pHolder.Controls.Add(menuCtrl)
    3. Your best option would be to add the following to the master page:
      <asp:PlaceHolder ID=”menuHolder runat=”server”>
      <div id=”menu”>
      <!– Menu code here –>
      </div>
      </asp:PlaceHolder>
    4. Your best option would be to add the following to the master page:
      <asp:PlaceHolder ID=”menuHolder runat=”server”>
      <!– Menu code here –>
      </asp:PlaceHolder>
    5. Your best option would be to add the following to the Page_Load event of the content page:
      Dim pHolder As PlaceHolder = TryCast( _
      Page.Master.FindControl(“menuHolder”), pHolder)
      Dim menuCtrl As New Menu()
      pHolder.Controls.Add(menuCtrl)

    Correct Answer: 5


    Question: You work as a Web Developer at Company.com. You make use of Microsoft ASP.NET 3.5 in order to create a Web application. You add the following HTML element to an ASP.NET page:

    <input type="hidden" name="HiddenField"/> 

    You want to retrieve the value of the element in the code-behind class. What should you do? (Choose all that apply)

    1. You should consider using the code: string value = Application[“HiddenField”].
    2. You should consider using the string value = ((HtmlInputHidden)Page.FindControl(“HiddenField”)).Valu
    3. You should consider using the string value = Request.Params[“HiddenField”].
    4. You should consider using the string value = Request.Form[“HiddenField”].
    5. You should consider using the string value = Context[“HiddenField”].

    Correct Answer: 3,4


    Question: You work as a Web Developer at Company.com. You are in the process of creating a Web application that uses Microsoft ASP.NET 3.5. You decide to enable session state for the application. You need to determine whether the session ID is maintained in the URL of the request. What should you do?

    1. The RequestType property of the HttpRequest class should be accesse
    2. The IsCookieless property of the HttpSessionState class should be accesse
    3. The UrlDecode method of the HttpServerUtility class should be accesse
    4. The UrlEncode method of the HttpServerUtility class should be accesse

    Correct Answer: 2


    Question: You work as an application developer at Company.com. You are in the process of creating an ASP.NET application that uses Microsoft .NET Framework 3.5. Your application contains a Web page named error.aspx. You receive an instruction from management to have unhandled exceptions writen to the Event log file while ensuring that the error.aspx page is displaye

  • What should you do?
    1. You should include <customErrors mode=”Off” defaultRedirect=”error.aspx” /> in the Web.config file and the code below to the Global.asax file:
      Public Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
      Dim app_excption As Exception = Server.GetError()
      ‘Write Exception details to event log
      End Sub
    2. You should include <customErrors mode=”On” defaultRedirect=”error.aspx” /> in the Web.config file and the code below to the Global.asax file:
      Public Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
      Dim app_excption As Exception = Server.GetError()
      ‘Write Exception details to event log
      End Sub
    3. You should include <customErrors mode=”On” defaultRedirect=”error.aspx” /> in the Web.config file and the code below to the Global.asax file:
      Public Sub Page_Error(ByVal sender As Object, ByVal e As EventArgs)
      Dim exc As Exception = Server.GetLastError()
      ‘Write Exception details to event log
      Server.ClearError()
      End Sub
    4. You should include <customErrors mode=”Off” defaultRedirect=”error.aspx” /> in the Web.config file and the code below to the Global.asax file:
      Public Sub Page_Error(ByVal sender As Object, ByVal e As EventArgs)
      Dim exc As Exception = Server.GetLastError()
      ‘Write Exception details to event log
      Server.ClearError()
      End Sub

    Correct Answer: 2


    Question: You work as a Web Developer at Company.com. You use Microsoft ASP.NET 3.5 to create a Web application. You add two files to the App_localResources folder. You name the files Default.aspx.resx and Default.aspx.fr-FR.resx. The Default.aspx.resx file includes the string resource:
    Name: WelcomeLabel.Text
    Value: Hello
    The Default.aspx.fr-FR.resx file includes the string resource:
    Name: WelcomeLabel.Text
    Value: Bonjour
    You need to display text from one of the localized resource files on the page named Default.aspx. You need to declare the Label control in order to display the text. What should you do?

    1. You should use the following:
      <asp:Label ID=”welcomeLabel” runat=”server” meta:resourcekey=”WelcomeLabel.Text”/>
    2. You should use the following:
      <asp:Label ID=”welcomeLabel” runat=”server” Text='<%$ Resources:WelcomeLabel%>’/>
    3. You should use the following:
      <asp:Label ID=”welcomeLabel” runat=”server”
      Text='<%$ Resources:WelcomeLabel, Text%>’/>
    4. You should use the following:
      <asp:Label ID=”welcomeLabel” runat=”server” meta:resourcekey=”WelcomeLabel”/>

    Correct Answer: 4

  • Tagged . Bookmark the permalink.

    Leave a Reply