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

certleader.com

Q1. - (Topic 4) 

You are developing an ASP.NET MVC application that will be deployed to servers on multiple networks. 

The application must be compatible with multiple browsers. You must track the page number that the user is viewing in search results. 

You need to program the location for storing state information. 

Where should you persist state information? 

A. Session 

B. QueryString 

C. Application 

D. TempData 

Answer:

Q2. - (Topic 3) 

You need to maximize performance of video delivery. 

Which code segment should you use as the body of the GetVideoStream function in the Video-Controller class? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

Q3. - (Topic 4) 

You are designing a distributed application. 

The application must store secure information that is specific to an individual user. The data must be automatically purged when the user logs off. 

You need to save transient information in a secure data store. 

Which data store should you use? 

A. Session state 

B. Database storage 

C. Profile properties 

D. Application state 

Answer:

Q4. HOTSPOT - (Topic 3) 

The designer for the website gave you the following image as the design for the page. 

The normal color for the tab is *2da4c2, and the color when the mouse is over the tab is #ffd800. 

The HTML that implements the navigation tab is as follows. 

You need to implement the design. 

What should you do? (To answer, select the appropriate options in the answer area.) 

Answer:  

Q5. HOTSPOT - (Topic 4) 

You are developing an ASP.NET MVC application that has pages for users who browse the site with Windows Phone 7. 

The pages for Windows Phone 7 include the following files: 

. _Layout.WP7.cshtml 

. Index.WP7.cshtml 

You need to update the application so that it renders the customized files correctly to Windows Phone 7 users. 

How should you update the Application_Start method? (To answer, select the appropriate option from the drop-down list in the answer area.) 

Answer:  

Q6. - (Topic 2) 

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

What should you do? 

A. Modify the RegisterGlobalFilters method of the Global.asax.cs file as follows. Contract.Assume<ArgumentException>(productId != 0); 

B. Modify the GetDealPrice method of ProductController as follows. Contract.Requires<ArgumentException>(productId > 0); 

C. Modify the RegisterGlobalFilters method of the Global.asax.cs file as follows. Contract.Requires<ArgumentException>(productId > 0); 

D. Modify the GetDealPrice method of ProductController as follows. Contract.Assume<ArgumentException>(productId > 0); 

Answer:

Explanation: 

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. 

Reference: Contract.Requires(Of TException) Method (Boolean) 

Q7. - (Topic 4) 

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 state information. 

You need to persist the application state during the session. 

What should you implement? 

A. A state server 

B. Cookieless sessions 

C. A web garden on the web servers 

D. An InProc session 

Answer:

Q8. - (Topic 2) 

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? 

A. If (Request.IsTabletDevice) 

B. If (Request.Browser.IsBrowser("Mobile")) 

C. If (Request.UserAgent["Tablet"]) 

D. If (Request.Browser.IsMobileDevice) 

Answer:

Q9. - (Topic 4) 

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 

Answer: A,B 

Q10. - (Topic 1) 

You need to make the "Distance" header of the table bold in the Views/RunLog/GetLog.cshtml view. 

Which code segment should you use? 

A. table>tr{ font-weight: bold; } 

B. table>th:last-child{ font-weight: bold; } 

C. table+first-child{ font-weight: bold; } 

D. table>tr>th:nth-child (2) { font-weight: bold; } 

Answer: