PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

Which code fragment should you use?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework
version 3.5. The application consumes an ASMX Web service. The Web service is hosted at
the following URL.
http://www.contoso.com/TemperatureService/Convert.asmx
You need to ensure that the client computers can communicate with the service as part of the
<system.serviceModel> configuration. Which code fragment should you use?

What should you do to ensure that the data in the updated records is validated before it is saved to the data

You create an application by using the Microsoft .NET Framework 3.5 and Microsoft
ADO.NET.The application loads customer records into a DataTable object that is contained
in a database. The records in the DataTable object will be updated by the users of the
application. The data in the updated records might contain errors.You need to ensure that the
data in the updated records is validated before it is saved to the database.What should you do?

What should you do?

You are creating an application by using Microsoft .NET Framework 3.5. You use Windows Communication Foundation (WCF) to create the application. The YourUserNamePasswordValidator class is implemented in the host application of the WCF service. The host application is named YourServiceHost.exe. You write the following code segment.

namespace YourSecureService
{
class YourUserNamePasswordValidator : UserNamePasswordValidator {
public override void Validate(string userName, string password)
{

}}
}

You need to perform custom validation of the user name and password by using the YourUserNamePasswordValidator class. What should you do?

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 insert at line 15?

You are creating a Windows Communication Foundation (WCF) service by using Microsoft .NET Framework 3.5. The service will authenticate the client applications by using Personal Information Cards. You write the following code segment. (Line numbers are included for reference only.)

01 public class CustomServiceAuthorizationManager :
02 ServiceAuthorizationManager {
03 protected override bool CheckAccessCore(OperationContext 04 operationContext)
05 {
06 string action=
07 operationContext.RequestContext.RequestMessage.
08 Headers.Action;
09 if (action == “http://tempuri.org/IEngine/Update”) 10 {
11 foreach (ClaimSet cs in
12 operationContext.ServiceSecurityContext.AuthorizationContext.
13 ClaimSets)
14 {
16 }
17 return false;
18 }
19 return true;
20 }
21 bool IsEmailValid(string email)
22 {
23 //e-mail validation is performed here;
24 return true;
25 }
You need to ensure that only those client applications that provide a valid e-mail address can execute the Update method. 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.

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 should you do?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework
version 3.5.You plan to submit text that contains HTML code to a page in the
application.You need to ensure that the HTML code can be submitted successfully without
affecting other applications that run on the Web server.What should you do?

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?