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

certleader.com

Q1. - (Topic 1) 

If the canvas element is supported by the client browser, the application must display "London 2012" in the footer as text formatted by JavaScript at the end of the _Layout.cshtml file. 

You need to modify the layout to ensure that "London 2012" is displayed as either formatted text or as plain text, depending on what the client browser supports. 

Which code segment should you add? 

A. <canvas id="myFooter"> 

@(Request,Browser.JavaApplets ? new HtmlString("London 2012") : null) 

</canvas> 

B. <canvas id="myFooter">London 2012</canvas> 

C. <canvas id="myCanvas">London 2012</canvas> 

D. <canvas id="myCanvas"></canvas> 

<p>London 2012</p> 

Answer:

Q2. HOTSPOT - (Topic 4) 

You are developing an ASP.NET MVC application in Visual Studio 2012. The application supports multiple cultures. 

To set the culture, the application must use the AcceptLanguage header field value sent by the client browser. 

You need to ensure that the application can set the culture. You have the following markup in the web.config file: 

Which markup segments should you include in Target 1, Target 2 and Target 3 to complete the markup? (To answer, select the appropriate options in the answer area.) 

Answer:  

Q3. - (Topic 3) 

You are creating a new authentication system that uses an HTTP header value. 

The existing authentication system must continue to operate normally. 

You need to implement the custom authentication. 

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

apply.) 

A. Create a class derived from ActionResult and check for a valid HTTP header value in the ExecuteResult method. Change all actions to return this new class. 

B. Create an HttpHandler to check for a valid HTTP header value in the ProcessRequest method. 

C. Create an HttpModule and check for a valid HTTP header value in the AuthenticateRequest event. 

D. Create a class derived from AuthorizeAttribute and check for a valid HTTP header value in the AuthorizeCore method. Change usages of the existing AuthorizeAttribute to use the new class. 

Answer: C,D 

Q4. - (Topic 4) 

You are preparing for the deployment of an ASP.NET MVC application. You need to generate a deployment manifest. 

Which command-line tool should you use? 

A. Mage.exe 

B. Ngen.exe 

C. ALexe 

D. Resgen.exe 

Answer:

Explanation: Al.exe generates a file with an assembly manifest from one or more files that are either resource files or Microsoft intermediate language (MSIL) files. 

Q5. - (Topic 4) 

You are designing an enterprise-level Windows Communication Foundation (WCF) application. User accounts will migrate from the existing system. The new system must be able to scale to accommodate the increasing load. 

You need to ensure that the application can handle large-scale role changes. 

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

A. Resource-based trusted subsystem model 

B. Identity-based approach 

C. Role-based approach 

D. Resource-based impersonation/delegation model 

Answer: B,C 

Explanation: Advanced Maturity: Authorization as a Service In the advanced level of maturity for authorization, role storage and management is consolidated and authorization itself is a service available to any solution that is service-enabled. 

* The Trusted Subsystems Model 

Once authorization is available as an autonomous service, the need for impersonation is eliminated. Instead of assuming the identity of the user, the application uses its own credentials to access services and resources, but it captures the user's identity and passes it as a parameter (or token) to be used for authorization when a request is made. This model is referred to as the trusted subsystem model, because the application acts as a trusted subsystem within the security domain. 

Q6. HOTSPOT - (Topic 4) 

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: 

The application includes the following class: 

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. 

Answer:  

Q7. - (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) 

Q8. - (Topic 4) 

You are developing an ASP.NET MVC application in Visual Studio 2012. The application supports multiple cultures. 

The application contains three resource files in the Resources directory: 

My Dictionary.resx 

MyDictionary.es.resx 

MyDictionary.fr.resx 

Each file contains a public resource named Title with localized translation. 

The application is configured to set the culture based on the client browser settings. 

The application contains a controller with the action defined in the following code segment. (Line numbers are included for reference only.) 

You need to set ViewBag.Title to the localized title contained in the resource files. 

Which code segment should you add to the action at line 03? 

A. ViewBag.Title = HttpContext.GetGlobalResourceObuect("MyDictionary", "Title"); 

B. ViewBag.Title = HttpContext.GetGlobalResourceObject("MyDictionary", "Title", new System.Globalization.CultureInfo("en")); 

C. ViewBag.Title = Resources.MyDictionary.Title; 

D. ViewBag.Title = HttpContext.GetLocalResourceObject("MyDictionary", "Title"); 

Answer:

Q9. DRAG DROP - (Topic 3) 

You need to ensure that the transcode.exe utility is installed before the worker role starts. 

How should you implement the startup task? (To answer, drag the appropriate values to the correct element or attribute. Each value 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.) 

Answer:  

Q10. - (Topic 2) 

An advertising campaign was recently launched. Some of the ads contain a link to products that no longer exist or have IDs that have changed. 

You need to ensure that all product links display a product. 

Which code segment should you use to configure the route? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer: