Microsoft 70-486 Developing ASP.NET MVC 4 Web Applications Exam Practice Test

Page: 1 / 14
Total 231 questions
Question 1

You updated the web.config file with the HTTP run-time value required to display an alternative version of the site.

You need to ensure that the correct page displays to the users.

Which code segment should you use to update the controller?



Answer : D


Question 2

You need to modify the application to meet the productId requirement.

Which code segment should you use?



Answer : C

Scenario: The value of the productId property must always be greater than 0.

Note: The Contract.Requires(Of TException) method specifies a precondition contract for the enclosing method or property, and throws an exception if the condition for the contract fails.

Syntax:

'Declaration

Public Shared Sub Requires(Of TException As Exception) ( _ condition As Boolean _)

Type Parameters

TException

The exception to throw if the condition is false.

Parameters condition

Type: System.Boolean

The conditional expression to test.


Question 3

The GetDealPrice method must be called by using Ajax.

You need to get the price of a product by using the GetDealPrice method of the ProductController.

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



Answer : C, D


Question 4

You updated the web.config file with the HTTP run-time value required to display an alternative version of the site.

You need to ensure that the correct page displays to the users.

Which code segment should you use to update the controller?



Answer : D


Question 5

When users attempt to retrieve a product from the product page, a run-time exception occurs if the product does not exist.

You need to route the exception to the CustomException.aspx page.

Which method should you add to MvcApplication?



Answer : B


Question 6

You need to implement the business requirements for managing customer data.

What should you do? (Each correct answer presents part of the solution. Choose all that apply.)



Answer : A, B


Question 7

You need to modify the application to meet the productId requirement.

What should you do?



Answer : B

The Contract.Requires(Of TException) method specifies a precondition contract for the enclosing method or property, and throws an exception if the condition for the contract fails.

Syntax:

'Declaration

Public Shared Sub Requires(Of TException As Exception) ( _ condition As Boolean _)

Type Parameters

TException

The exception to throw if the condition is false.

Parameters

condition

Type: System.Boolean

The conditional expression to test.


Page:    1 / 14   
Total 231 questions