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
- 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> - 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) - 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> - Your best option would be to add the following to the master page:
<asp:PlaceHolder ID=”menuHolder runat=”server”>
<!– Menu code here –>
</asp:PlaceHolder> - 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)
- You should consider using the code: string value = Application[“HiddenField”].
- You should consider using the string value = ((HtmlInputHidden)Page.FindControl(“HiddenField”)).Valu
- You should consider using the string value = Request.Params[“HiddenField”].
- You should consider using the string value = Request.Form[“HiddenField”].
- 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?
- The RequestType property of the HttpRequest class should be accesse
- The IsCookieless property of the HttpSessionState class should be accesse
- The UrlDecode method of the HttpServerUtility class should be accesse
- 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
- 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 - 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 - 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 - 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?
- You should use the following:
<asp:Label ID=”welcomeLabel” runat=”server” meta:resourcekey=”WelcomeLabel.Text”/> - You should use the following:
<asp:Label ID=”welcomeLabel” runat=”server” Text='<%$ Resources:WelcomeLabel%>’/> - You should use the following:
<asp:Label ID=”welcomeLabel” runat=”server”
Text='<%$ Resources:WelcomeLabel, Text%>’/> - You should use the following:
<asp:Label ID=”welcomeLabel” runat=”server” meta:resourcekey=”WelcomeLabel”/>
Correct Answer: 4