Latest 70-515 Real Exam Download 151-160

Ensurepass

QUESTION 151

You are implementing an ASP.NET Web page

The page includes several controls, but only a GridView requires view state. You set the GridView… You need to ensure that the page will omit unneeded view state.

Wich @ Page directive should you use?

A. <% Page EnableViewState=”true” ViewStateMode=”Enabled” _ %>

B. <% Page EnableViewState=”true” ViewStateMode=”Disabled” _ %>

C. <% Page EnableViewState=”false” ViewStateMode=”Disabled” _ %>

D. <% Page EnableViewState=”false” ViewStateMode=”Enabled” _ %>

Answer: B


QUESTION 152

You are debugging an ASP.NET Web application by using the Visual Studio debugger. The application is incorrectly handling a SQL Exception on the login page.

You need to break execution where the exception is thrown . What should you do?

A. Enable the User-unhandled option for SqlException in Visual Studio Exception configuration.

B. Set the value of the customErrors element’s mode attribute to “on” in the web.config file.

C. Manually attach the Visual Studio debugger to Internet Explorer

D. Enable the thrown option for SqlException in Visual Studio exception configuration.

Answer: D


QUESTION 153

You have a C# code snippet with 2 classes, one composed by elements of the other.

Something like

public class Student

{

public string Name {get;set;}

}

public class Supervisor

{

public string name {get;set;}

public List<Student> {get;set;}

}

And a markup code snippet, with 2 repeaters imbricated + a ObjectDataSource retrieving a list of Supervisors, the top level repeater "rptSupervisors" is bound using ObjectDataSourceID to the ObjectDataSource, and the inside one "rptStudents" is not bound yet.

We understand that we need a list of supervisors and sublists of their relative students.

A. bind rptStudents with the list of current item in SupervisorsList using the ItemDataBound event of the rptStudents repeater

B. bind rptStudents with the list of current item in SupervisorsList using the ItemCommand event of the rptSupervisor repeater

C. databinding directly the rptStudents in the page load or something dummy like that (don’t remember exactly)

D. another dummy solution involving a "supervisors have all the same students" situation

Answer: B


QUESTION 154

You create a Windows Communication Foundation (WCF) service and deploy it with wsHttpBinding and message security enabled. You create an intermediate WCF service for logging messages sent to the primary service. The intermediate service is called via endpoint behaviour. The primary service is receiving malformed data from a client application. You need to enable inspection of the malformed data and prevent message tampering. What do you do?

A. Specify a protection level of None in the contract for the intermediate service. Disable message and transport security from the client application configuration file.

B. Specify a protection level of Sign in the contract for the intermediate service. Disable transport security from the client application configuration file.

C. Modify the binding on the intermediate service to use netNamedPipeBinding

D. Modify the binding on the intermediate service to use webHttpBinding

Answer: B


QUESTION 155

You need to ensure that when the button is clicked, both update panels update the tim without generating a postback.

What should you do?

A. Add the following marktip to UpdatePanel1.

<Triggers>

<asp:PostBackTrigger ControlID="btnSave" />

</Triggers>

B. Set the UpdateMode property for the UpdatePanel2 to "Always"

C. Add the following markup to UpdatePanel1

<Triggers>

<asp:AsyncPostBackTrigger ControlID="btnSave" EventName="Click" />

</Triggers>

D. Set the UpdateMode property for UpdatePanel2 to "Conditional"

Answer: A


QUESTION 156

You are developing an ASP.NET MVC2 view and controller.

The application includes a class names Employee that has a LastName property. The controller requires

an action method that will insert an Employee instance into a database.

You need to ensure that the data that is submitted is an Employee instance and that a LastName value is given.

What should you do?

A. Add a ValidationMessage helper method immediately after the view’s last name TextBox. Define the action method as follows.

public ActionResult Create(FormCollection employeeToCreate)

{…}

B. Add the Required attribute to the LastName property. Define the action method as follows. public ActionResult Create(FormCollection employeeToCreate)

{…}

C. Add the Required attribute to the LastName property. Define the action method as follows. public ActionResult Create(Employee employeeToCreate)

{…}

D. Add the ValidationMessage helper method immediately after the views last name TextBox. Define the action method as follows.

public ActionResult Create(Employee employeeToCreate)

{…}

Answer: C


QUESTION 157

You are developing an ASP.NET MVC 2 Web Application.

You need to implement an asynchronous controller named AccountingController, and you must ensure that the export action required proper authorization.

Which code segment should you use?

A. public class AccountingController : Controller

{

public void ExportAsync() {…}

[Authorise]

public void ExportCompleted() {…}

}

B. public class AccountingController : AsyncController

{

[Authorise]

public void ExportAsync() {…}

public void ExportCompleted() {…}

}

C. public class AccountingController : AsyncController

{

[Authorise]

public void Export() {…}

}

D. public class AccountingController : Controller

{

[Authorise]

public void ExportAsync() {…} [Authorise]

public void ExportCompleted() {…}

}

Answer: B


QUESTION 158

You are developing an ASP.NET Web page that uses jQuery validation.

The user should enter a valid email address in a text box that has ID txtEmail. The page must display "E- Mail address required" when the user does not enter an address and "Invalid e-mail address" when the user enters an address that is not formatted properly.

You need to ensure that the appropriate error message is displayed when the text box does not contain a valid e-mail address.

Which two code segments should you add? (Choose 2)

A. txtEmail:

{

messages:

{

required: "E-mail address required", email: "Invalid e-mail address"

}

}

B.

messages:

{

txtEmail:

{

required: "E-mail address required", email: "Invalid e-mail address"

}

}

C.

txtEmail:

{

rules:

{

required: true email: true

}

}

D.

rules:

{

txtEmail:

{

required: true email: true

}

}

Answer: BD


QUESTION 159

Corrected :
QUESTION No: 149

You create an ASP.NET server control in the SampleControl namespace.

The control uses a JavaScript file names Refresh.js to implement AJAX functionality. You need to ensre that the JavaScript file is included in the assembly.

Which two actions should you perform (Choose 2)

A. Add the following assembly attribute to the AssemblyInfo file. [assembly: WebResource("SampleControl.Refresh.js", "application/x-javascript")]

B.

Add the following assembly attribute to the AssemblyInfo file. [assembly:ScriptResource("SampleControl.Refresh.js")]

C. In the Properties window for the Refresh.js file, set the Build Action to Embedded Resource.

D. In the Properties window for the Refresh.js file, set the Build Action to Content.

Answer: AC


QUESTION 160

You are developing a WCF service.

The service includes an operation names GetProduct.

You need to ensure that GetProduct will accept a POST request and will indicate that the returned data is XML.

Which two actions should you perform (Choose 2)

A. Add the WebGet attribute to the service contract.

B. Set WebOperationContext.Current.OutgoingRequest.ContentType to "text/xml" in the GetProduct method.

C. Add the WebInvoke attribute to the service contract.

D. Set WebOperationContext.Current.OutgoingResponse.ContentType to "text/xml" in the GetProduct method.

Answer: CD

Download Latest 70-515 Real Free Tests , help you to pass exam 100%.