Ensurepass

QUESTION 81

HOTSPOT

You are developing an ASP.NET MVC application. The layout page of the application references the jQuery library. You develop a view that uses the layout page. The view includes the following markup:

 

clip_image002

 

The application includes the following class:

 

clip_image004

 

When a user clicks the button, an AJAX call must retrieve the partial view and append it to the newBooks div element.

 

You need to implement the AJAX request.

 

How should you complete the relevant code?

 

To answer, select the appropriate code segment from each list in the answer area.

 

clip_image006

 

Correct Answer:

clip_image008

 

 

QUESTION 82

You are developing an ASP.NET MVC application that uses forms authentication to verify that the user is logged in.

 

Authentication credentials must be encrypted and secure so no user identity is exposed.

 

You need to ensure that user credentials are persisted after users log on.

 

Where should you store the credentials? (Each correct answer presents a complete solution. Choose all that apply.)

 

A.

In Session on the server

B.

In a cookie stored in the browser

C.

In ViewData in the application

D.

In TempData on the server

 

Correct Answer: AB

 

 

QUESTION 83

You are developing an ASP.NET MVC web application in Visual Studio 2012. The application requires several thousand content files. All content is hosted on the same IIS instance as the application.

 

You detect performance issues when the application starts.

 

You need to resolve the performance issues.

 

What should you do?

 

A.

Implement HTTP caching in the ASP.NET MVC controllers.

B.

Combine the content files by using ASP.NET MVC bundling.

C.

Install a second IIS instance.

D.

Move the content to a Windows Azure CDN.

 

Correct Answer: B

 

 

QUESTION 84

You are developing an ASP.NET MVC application that uses forms authentication. The application uses SQL queries that display customer order data.

 

Logs show there have been several malicious attacks against the servers.

 

You need to prevent all SQL injection attacks from malicious users against the application.

 

How should you secure the queries?

 

A.

Check the input against patterns seen in the logs and other records.

B.

Escape single quotes and apostrophes on all string-based input parameters.

C.

Implement parameterization of all input strings.

D.

Filter out prohibited words in the input submitted by the users.

 

Correct Answer: C

Explanation:

SQL Injection Prevention, Defense Option 1: Prepared Statements (Parameterized Queries)

The use of prepared statements (aka parameterized queries) is how all developers should first be taught how to write database queries. They are simple to write, and easier to understand than dynamic queries. Parameterized queries force the developer to first define all the SQL code, and then pass in each parameter to the query later. This coding style allows the database to distinguish between code and data, regardless of what user input is supplied.

 

Prepared statements ensure that an attacker is not able to change the intent of a query, even if SQL commands are inserted by an attacker.

 

Reference: SQL Injection Prevention Cheat Sheet

QUESTION 85

DRAG DROP

You are developing an ASP.NET MVC application in Visual Studio 2012. The application processes data for a bakery and contains a controller named BagelController.es that has several actions. The GetBagel action is defined in the following code segment.

 

clip_image010

 

The GetBagel action is the only action that should be accessed via a URL pattern. Routes to the other actions in the controller must be suppressed.

 

The default route must map to HomeController and the Index action.

 

You need to build the routes.

 

Which three code segments should you use in sequence?

 

To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.

 

clip_image012

 

Correct Answer:

clip_image014

 

 

QUESTION 86

You are developing an ASP.NET MVC application. The application is deployed in a web farm and is accessed by many users.

 

The application must handle web server failures gracefully. The servers in the farm must share the short-term state information.

 

You need to persist the application state during the session.

 

What should you implement?

 

A.

ASP.NET session state

B.

A local database

C.

A state server

D.

Profile properties

 

Correct Answer: C

 

 

QUESTION 87

You are implementing a website redesign of an existing website that provides historical weather condition maps.

 

The current layout resembles the graphic in the exhibit. (Click the Exhibit button.)

 

clip_image016

 

Year selection is implemented as a set of links, which causes the page to reload when the user changes the year. The year selection HTML is contained in a div with an id of “year- selector”.

 

You need to modify the page so that the user can change the year without the page reloading.

 

You also need to ensure that there is minimal change to the design of the page.

 

Which code segment should you use?

 

clip_image018

A.

Option A

B.

Option B

C.

Option C

D.

Option D

 

Correct Answer: A

 

 

QUESTION 88

DRAG DROP

You are de
veloping an ASP.NET MVC application.

 

Before an action is executed, information about the action must be written to a log. After results are returned, information about the results also must be written to the log.

 

You need to log the actions and results.

 

You have the following code:

 

clip_image020

 

Which code segments should you include in Target 1, Target 2 and Target 3 to implement the LogActionFilter class?

 

To answer, drag the appropriate code segments to the correct targets. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.

 

clip_image022

 

Correct Answer:

clip_image024

 

 

QUESTION 89

You are designing an HTML5 website.

 

You need to design the interface to make the content of the web page viewable in all types of browsers, including voice recognition software, screen readers, and reading pens.

 

What should you do? (Each correct answer presents a complete solution. Choose all that apply.)

 

A.

Annotate HTML5 content elements with Accessible Rich Internet Application (ARIA) attributes.

B.

Convert HTML5 forms to XForms.

C.

Ensure that HTML5 content elements have valid and descriptive names.

D.

Use HTML5 semantic markup elements to enhance the pages.

E.

Use Resource Description Framework (RDF) to describe content elements throughout the entire page.

 

Correct Answer: AD

 

 

QUESTION 90

You are developing an ASP.NET MVC application that enables you to edit and save a student object.

 

The application must not retrieve student objects on an HTTP POST request.

 

You need to implement the controller.

 

Which code segment should you use? (Each correct answer presents a complete solution. Choose all that apply.)

 

clip_image026

A.

Option A

B.

Option B

C.

Option C

D.

Option D

 

Correct Answer: AC

Explanation:

Reference: Examining the Details and Delete Methods

http://www.asp.net/mvc/overview/getting-started/introduction/examining-the-details-and- delete-methods

 

Free VCE & PDF File for Microsoft 70-494 Real Exam

Instant Access to Free VCE Files: MCSE|MCSA|MCITP…
Instant Access to Free PDF Files: MCSE|MCSA|MCITP…