PrepAway - Latest Free Exam Questions & Answers

Tag: 70-562

Which code fragment should you insert at line 10?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a Web form in the application by using the following code fragment. (Line numbers are included for reference only.)
01 <script runat="server">
02 Protected Sub Button_Handler(sender As Object, e As EventArgs)
03 ‘ some long-processing operation.
04
05 End Sub
06 </script>
07 <div>
08 <asp:ScriptManager ID="defaultScriptManager"
09 runat="server" />
10
11 <asp:UpdatePanel ID="defaultPanel"
12 UpdateMode="Conditional" runat="server">
13 <ContentTemplate>
14 <!– more content here –>
15 <asp:Button ID="btnSubmit" runat="server"
16 Text="Submit" OnClick="Button_Handler" />
17 </ContentTemplate>
18 </asp:UpdatePanel>
19 </div>
You plan to create a client-side script code by using ASP.NET AJAX.
You need to ensure that while a request is being processed, any subsequent Click events on the btnSubmit Button control are suppressed.
Which code fragment should you insert at line 10?

Which method should you add to the Web page?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create two user controls named UserCtrlA.ascx and UserCtrlB.ascx. The user controls postback to the server.
You create a new Web page that has the following ASPX code.
<asp:CheckBox ID="Chk" runat="server" oncheckedchanged="Chk_CheckedChanged" AutoPostBack="true" />
<asp:PlaceHolder ID="PlHolder" runat="server"></asp:PlaceHolder>
To dynamically create the user controls, you write the following code segment for the Web page.

Public Sub LoadControls()
If ViewState("CtrlA") IsNot Nothing Then
Dim c As Control
If CBool(ViewState("CtrlA")) = True Then
c = LoadControl("UserCtrlA.ascx")
Else
c = LoadControl("UserCtrlB.ascx")
End If
c.ID = "Ctrl"
PlHolder.Controls.Add(c)
End If
End Sub

Protected Sub Chk_CheckedChanged(sender As Object, e As EventArgs)
ViewState("CtrlA") = Chk.Checked
PlHolder.Controls.Clear()
LoadControls()
End Sub

You need to ensure that the user control that is displayed meets the following requirements:
It is recreated during postback It retains its state.
Which method should you add to the Web page?

Which code segment should you insert at line 04?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create the following controls:
A composite custom control named MyControl.
A templated custom control named OrderFormData.
You write the following code segment to override the method named CreateChildControls() in the MyControl class. (Line numbers are included for reference only.)

01 Protected Overrides Sub CreateChildControls()
02 Controls.Clear()
03 Dim oFData As New OrderFormData("OrderForm")
04
05 End Sub

You need to add the OrderFormData control to the MyControl control.
Which code segment should you insert at line 04?

Which markup should you use?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. The application contains a mobile Web page.
You add the following StyleSheet control to the Web page.

<mobile:StyleSheet id="MyStyleSheet" runat="server">
<mobile:Style Name="StyleA" Font-Name="Arial" Font-Bold="True" Wrapping="NoWrap">
</mobile:Style>
</mobile:StyleSheet>

You need to add a Label control named MyLabel that uses the defined style in the MyStyleSheet StyleSheet control.
Which markup should you use?

Which DeviceSpecific element should you insert at line 02?

You create a Microsoft ASP.NET Web application by using the Microsoft .NET Framework version 3.5.
The application contains the following device filter element in the Web.config file.
<filter name="isHtml" compare="PreferredRenderingType"argument="html32" />
The application contains a Web page that has the following image control. (Line numbers are included for reference only.)

01 <mobile:Image ID="imgCtrl" Runat="server">
02
03 </mobile:Image>

You need to ensure that the following conditions are met:
The imgCtrl Image control displays the highRes.jpg file if the Web browser supports html
The imgCtrl Image control displays lowRes.gif if the Web broser does not support html.
Which DeviceSpecific element should you insert at line 02?

Which code segment should you insert at line 06?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a login Web form by using the following code fragment.
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:TextBox runat="server" ID="txtUser" Width="200px" />
<asp:TextBox runat="server" ID="txtPassword" Width="200px" />
<asp:Button runat="server" ID="btnLogin" Text="Login" OnClientClick="login(); return false;" />
When a user clicks the btnLogin Button control, the login() client-side script is called to authenticate the user. The credentials provided in the TextBox controls are used to call the client-side script.
You also add the following client-script code fragment in the Web form. (Line numbers are included for reference only.)

01 <script type="text/javascript">
02 function login() {
03 var username = $get(‘txtUser’).value;
04 var password = $get(‘txtPassword’).value;
05
06 // authentication logic.
07 }
08 function onLoginCompleted(validCredentials, userContext,
09 methodName)
10 {
11 // notify user on authentication result.
12 }
13
14 function onLoginFailed(error, userContext, methodName)
15 {
16 // notify user on authentication exception.
17 }
18 </script>

The ASP.NET application is configured to use Forms Authentication. The ASP.NET AJAX authentication service is activated in the Web.config file.
You need to ensure that the following workflow is maintained:
On successful authentication, the onLoginCompleted clien-script function is called to notify the user.
On failure of authentication, the onLoginFailed clien-script function is called to display an error message.
Which code segment should you insert at line 06?

Which code segment should you insert at line 06?

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 <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="ScriptManager1"
12 runat="server" />
13 <asp:TextBox runat="server" ID="TextBox1" />

You need to create and initialize a client behavior named MyCustomBehavior by using the initComponents function. You also need to ensure that MyCustomBehavior is attached to the TextBox1 Textbox control.
Which code segment should you insert at line 06?

Which code fragment should you insert at line 11?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You add the following code fragment to the Web.config file of the application (Line numbers are included for reference only).
01 <healthMonitoring>
02 <providers>
03 <add name="EventLogProvider"
04 type="System.Web.Management.EventLogWebEventProvider
05 />
06 <add name="WmiWebEventProvider"
07 type="System.Web.Management.WmiWebEventProvider
08 />
09 </providers>
10 <eventMappings>
11
12 </eventMappings>
13 <rules>
14 <add name="Security Rule" eventName="Security Event"
15 provider="WmiWebEventProvider" />
16 <add name="AppError Rule" eventName="AppError Event"
17 provider="EventLogProvider" />
18 </rules>
19 </healthMonitoring>
You need to configure Web Events to meet the following requirements:
Security-related Web Events are mapped to Microsoft Windows Management Instrumentation (WMI) events.
Web Events caused by problems with configuration or application code are logged into the Windows Application Event Log.
Which code fragment should you insert at line 11?

What are three possible reasons that could cause this increase?

You create a Microsoft ASP.NET Web application by using the Microsoft .NET Framework version 3.5.
When you review the application performance counters, you discover that there is an unexpected increase in the value of the Application Restarts counter.
You need to identify the reasons for this increase.
What are three possible reasons that could cause this increase? (Each correct answer presents a complete solution. Choose three.)

Which code fragment should you use?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
The application is deployed on a Microsoft IIS 6.0 Web server by using the default ASP.NET version 2.0 application pool and Windows Authentication.
The application contains functionality to upload files to a location on a different server.
Users receive an access denied error message when they attempt to submit a file.
You need to modify the Web.config file to resolve the error.
Which code fragment should you use?


Page 3 of 812345...Last »