PrepAway - Latest Free Exam Questions & Answers

Category: 70-567

Exam 70-567: UPGRADE: Transition your MCPD Web Developer Skills to MCPD ASP.NET Developer 3.5

What should you do?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.

The application uses 10 themes and allows the users to select their themes for the Web page.

When a user returns to the application, the theme selected by the user is used to display pages in the application. This occurs even if the user returns to log on at a later date or from a different client computer.

The application runs on different storage types and in different environments.

You need to store the themes that are selected by the users and retrieve the required theme.

What should you do?

Which code segment should you insert at line 15?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.

You create a class that contains the following code segment. (Line numbers are included for reference only.)

01 public object GetCachedProducts(sqlConnection conn) {
02
03 if (Cache[“products”] == null) {
04 SqlCommand cmd = new SqlCommand(
05 “SELECT * FROM Products”, conn);
07 conn.Open();
08 Cache.Insert(“products”, GetData(cmd));
09 conn.Close();
10 }
11 return Cache[“products”];
12 }
13
14 public object GetData(SqlCommand prodCmd) {
15
16 }

Each time a Web form has to access a list of products, the GetCachedProducts method is called to provide this list from the Cache object.

You need to ensure that the list of products is always available in the Cache object.

Which code segment should you insert at line 15?

Which code segment should you use?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
The application consumes a Microsoft Windows Communication Foundation (WCF) service.

The WCF service exposes the following method.

[WebInvoke]
string UpdateCustomerDetails(string custID);

The application hosts the WCF service by using the following code segment.
WebServiceHost host = new WebServiceHost(typeof(CService), new Uri(“http://win/”));
ServiceEndpoint ep = host.AddServiceEndpoint(typeof(ICService), new WebHttpBinding(), “”);

You need to invoke the UpdateCustomerDetails method.

Which code segment should you use?

Which code segment should you use?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.

You write the following code fragment.
<asp:ScriptManager ID=”ScriptManager1″ runat=”server” />
<asp:UpdatePanel ID=”updateLabels” runat=”server” UpdateMode=”Conditional”>
<ContentTemplate>
<asp:Label ID=”Label1″ runat=”server” />
<asp:Label ID=”Label2″ runat=”server” />
<asp:Button ID=”btnSubmit” runat=”server” Text=”Submit”
onclick=”btnSubmit_Click” />
</ContentTemplate>
</asp:UpdatePanel>
<asp:Label id=”Label3″ runat=”server” />

You need to ensure that when you click the btnSubmit Button control, each Label control value is asynchronously updatable.

Which code segment should you use?

What should you do?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.

You write the following code segment to create a client-script function. (Line numbers are included for reference only.)

01 function updateLabelControl(labelId, newText) {
02 var label = $find(labelId);
03 label.innerHTML = newText;
04 }

The client script function uses ASP.NET AJAX and updates the text of any Label control in the Web form.

When you test the client script function, you discover that the Label controls are not updated. You receive the following JavaScript error message in the browser: “‘null’ is null or not an object.”

You need to resolve the error.

What should you do?

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 client-script function is called to notify the user.
* On failure of authentication, the onLoginFailed client-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 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 override void
02 CreateChildControls() {
03 Controls.Clear();
04 OrderFormData oFData = new
05 OrderFormData(“OrderForm”);
06
07 }

You need to add the OrderFormData control to the MyControl control.

Which code segment should you insert at line 06?

Which override method should you use?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.

You derive a new validation control from the BaseValidator class.

The validation logic for the control is implemented in the Validate method in the following manner.

protected static bool Validate(string value) {

}

You need to override the method that validates the value of the related control.

Which override method should you use?

Which code segment should you use?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.

You write the following code fragment.

<asp:ListBox SelectionMode=”Multiple” ID=”ListBox1″ runat=”server”></asp:ListBox>
<asp:ListBox ID=”ListBox2″ runat=”server”></asp:ListBox>
<asp:Button ID=”Button1″ runat=”server” Text=”Button” onclick=”Button1_Click” />

You need to ensure that when you click the Button1 control, a selected list of items move from the ListBox1 control to the ListBox2 control.

Which code segment should you use?

What you should do?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.

You write the following code fragment.

<asp:RadioButton ID=”RadioButton1″ runat=”server” oncheckedchanged=”RadioButton_CheckedChanged”/>
<asp:RadioButton ID=”RadioButton2″ runat=”server” oncheckedchanged=”RadioButton_CheckedChanged”/>
<asp:RadioButton ID=”RadioButton3″ runat=”server” oncheckedchanged=”RadioButton_CheckedChanged”/>

You need to ensure that the following requirements are met:

* Users can select only one RadioButton control at a time.
* The Web page is not reloaded when a RadioButton control is selected.

What you should do?


Page 5 of 11« First...34567...10...Last »