70-486 Premium Bundle

70-486 Premium Bundle

Developing ASP.NET MVC 4 Web Applications Certification Exam

4.5 
(2160 ratings)
0 QuestionsPractice Tests
0 PDFPrint version
November 21, 2024Last update

Microsoft 70-486 Free Practice Questions

Q1. - (Topic 3) 

You need to ensure that developers can connect to a Microsoft Azure role by using RDP. 

What should you do? 

A. Export a certificate with a private key. Upload the .pfx file to the Certificates section under the TranscodeWorkerRole hosted service on the Azure Management Portal. 

B. Export a certificate with a private key. Upload the .pfx file to the Management Certificates section on the Azure Management Portal. 

C. Export a certificate without a private key. Upload the .cer file to the Management Certificates section on the Azure Management Portal. 

D. Export a certificate without a private key. Upload the .cer file to the Certificates section under the TranscodeWorkerRole hosted service on the Azure Management Portal. 

Answer:

Explanation: In case you don’t want to use the RDP certificate created by Windows Azure Tools and want to use a custom certificate instead, the following steps will guide you. These steps can also be used in case package is not being published from Visual Studio rather it is being built locally, saved in either Local Machine's Drive or Windows Azure Blob Storage and subsequently published from there. 

Here are the steps which are required to get pass the publishing error which you might be running into. You would need to upload the Certificate with Private Key to the portal (when Visual Studio is used this is done in the background). 

Detailed steps. 

1. 

In Visual Studio, go to the solution which is being developed. 

2. 

Right click the Web Project -> Configure Remote Desktop -> click on View to see Certificate details (Since I don’t have a custom certificate I will use one create by Windows Azure Tools itself) 

3. 

Go to Details tab on Certificate -> Click Copy to file.. -> Next -> Select ‘Yes, export the private key’ -> Next -> Continue with default setting and create a password when asked (please refer below screenshots) 

4. 

These steps will generate a .PFX file for this certificate. Now we need to upload this certificate to the portal (for the respective cloud service) 

5. 

Go to the Azure Management Portal -> Go to the Cloud Service in question -> Certificates Tab -> Upload the newly created certificate (.PFX file) 

Note: 

The certificates that you need for a remote desktop connection are different from the certificates that you use for other Azure operations. The remote access certificate must have a private key. 

Microsoft Azure uses certificates in three ways: / Management certificates – Stored at the subscription level, these certificates are used to enable the use of the SDK tools, the Windows Azure Tools for Microsoft Visual Studio, or the Service Management REST API Reference. These certificates are independent of any cloud service or deployment. / Service certificates – Stored at the cloud service level, these certificates are used by your deployed services. / SSH Keys – Stored on the Linux virtual machine, SSH keys are used to authenticate remote connections to the virtual machine. 

Reference: How to use Custom Certificate for RDP to Windows Azure Roles 

http://blogs.msdn.com/b/cie/archive/2014/02/22/how-to-use-custom-certificate-for-rdp-to-windows-azure-roles.aspx 

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 1) 

You need to make all of the rows in the table bold in the Views/RunLog/GetLog.cshtml view. 

Which code segment should you use? 

A. Table > th:last-child { font-weight: bold; } 

B. Table+first-child{ font-weight: bold; } 

C. Table>tr>th:nth-child{2){font-weight: bold; } 

D. Table > tr {font-weight: bold;} 

Answer:

Q4. 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:  

Q5. - (Topic 4) 

You are developing an ASP.NET MVC application that will be deployed on a web farm. 

Passwords must be stored in the web.config file and must not be readable or in a format 

that is easily decodable 

You need to encrypt the passwords that are stored in the web.config file. 

Which command-line tool should you use? 

A. Aspnet_regiis.exe 

B. Ngen.exe 

C. Aspnet_merge.exe 

D. EdmGen.exe 

Answer:

Explanation: http://msdn.microsoft.com/en-us/library/zhhddkxy(v=vs.100).aspx 

Q6. - (Topic 3) 

The transcode.exe utility activates its license online when it is installed. 

You need to ensure that the registration of the transcode utility is handled as specified in its 

license. 

Which method should you add to the TranscodeWorkerRole class? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

Q7. DRAG DROP - (Topic 4) 

You are developing an ASP.NET MVC application. The application has a view that displays a list of orders in a multi-select list box. 

You need to enable users to select multiple orders and submit them for processing. 

What should you do? (To answer, drag the appropriate words to the correct targets. Each word 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:  

Q8. - (Topic 4) 

You are developing an ASP.NET MVC application. 

You need to authenticate clients by using NT LAN Manager (NTLM). 

Which authentication method should you implement? 

A. Basic 

B. Windows 

C. Forms 

D. Kerberos 

Answer:

Explanation: http://msdn.microsoft.com/en-us/library/aa292114(v=vs.71).aspx 

Q9. - (Topic 4) 

You are developing an ASP.NET MVC application by using Visual Studio. 

The application throws and handles exceptions when it runs. 

You need to examine the state of the application when exceptions are thrown. 

What should you do? 

A. Add the following code to the web.config file of the application. 

<customErrors mode=”On” > 

<error statusCode=”404” redirect=”CustomErrors.html” /> 

</customErrors> 

B. From the Debug menu in Visual Studio, select Exceptions. Disable the User-unhandled 

check box for Common Language Runtime Exceptions. 

C. Add the following code to the web.config file of the application. 

<customErrors mode=“On” > 

<error statusCode=”500” redirect=”CustomErrors.html” /> 

</customErrors> 

D. From the Debug menu in Visual Studio, select Exceptions. Enable the Thrown check 

box for Common Language Runtime Exceptions. 

Answer:

Explanation: Configuring the debugger to break for first chance exceptions 

To change when the debugger breaks, go to Debug->Exceptions… 

When you first open this window you will see that there is a tree grid with one column and checkboxes. 

Break when Thrown. This includes a default list of exceptions known by the debugger, 

grouped by category. 

Note: The possible exceptions that could break from this list is determined by the runtime 

you are debugging. For example, if you are using managed-only debugging then the 

debugger will never break for C++, Win32 Exceptions, etc. even if they are configured to 

break when thrown. 

Checkboxes. If you check the box for a category, then the debugger will break for all First 

Chance Exceptions while debugging. If you don’t want to enable all First Chance 

Exceptions, you can find the specific exception types that you wish to configure by using 

the search box. 

Reference: Understanding Exceptions while debugging with Visual Studio 

http://blogs.msdn.com/b/visualstudioalm/archive/2015/01/08/understanding-exceptions-while-debugging-with-visual-studio.aspx 

Q10. DRAG DROP - (Topic 4) 

You are developing an ASP.NET MVC application that takes customer orders. 

Orders are restricted to customers with IP addresses based in the United States. 

You need to implement a custom route handler. 

How should you implement the route handler? (To answer, drag the appropriate line of code to the correct location or locations. Each line of code 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:  

Q11. - (Topic 4) 

You are developing an ASP.NET MVC application by using Visual Studio 2012. 

The application throws and handles exceptions when it runs. 

You need to examine the state of the application when exceptions are thrown. 

What should you do? 

A. From the Debug menu in Visual Studio 2012, select Exceptions. Enable the Thrown 

check box for Common Language Runtime Exceptions. 

B. From the Debug menu in Visual Studio 2012, select Exceptions. Disable the User-unhandled check box for Common Language Runtime Exceptions. 

C. Add the following code to the web.config file of the application. 

<customErrors mode="On" > 

<error statusCode="500" redirect="CustomErrors.html" /> 

</customErrors> 

D. Add the following code to the web.config file of the application. 

<customErrors mode="On" > 

<error statusCode="404" redirect="CustomErrors.html" /> 

</customErrors> 

Answer:

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

Q13. DRAG DROP - (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, drag the appropriate line of code to the correct location or locations. Each line of code 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:  

Q14. - (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 

Q15. - (Topic 4) 

You are developing an ASP.NET MVC application that supports multiple cultures and multiple languages. The application will be sold to international customers. 

The ASP.NET MVC application must store localized content in satellite assemblies for multiple languages. 

You need to generate the satellite assemblies during an automated build. 

Which tool should you use? 

A. Gacutil.exe 

B. Al.exe 

C. Ildasm.exe 

D. nasm.exe 

Answer:

Explanation: Use the Assembly Linker (Al.exe) to compile .resources files into satellite assemblies. Al.exe creates an assembly from the .resources files that you specify. By definition, satellite assemblies can only contain resources. They cannot contain any executable code. 

The following Al.exe command creates a satellite assembly for the application MyApp from the file strings.de.resources. 

al /t:lib /embed:strings.de.resources /culture:de /out:MyApp.resources.dll 

Q16. - (Topic 4) 

You need to enable client-side validation for an ASP.NET MVC application. 

Which three actions should you perform? Each correct answer presents part of the solution. 

A. Attach a custom validation attribute to the model properties that the view uses. 

B. Reference the jquery, jquery.validate and jquery.validate.unobtrusive script files in the view. 

C. Open the web.config file at the project root, and set the values of the ClientValidationEnabled and UnobtrusiveJavaScriptEnabled keys to True. 

D. For each form element, use the Validator.element() method to validate each item. 

E. Add data annotations to the model properties that the view uses. 

Answer: B,C,E 

Explanation: B: . The validation can be implemented using jQuery and jQuery validation plug-in (jquery.validate.min.js and jquery.validate.unobtrusive.min.js). 

C: When you are developing an MVC application in Visual Studio 2012 then the client-side 

becomes enabled by default, but you can easily enable or disable the writing of the 

following app setting code snippet in the web.config file. 

<configuration> 

<appSettings> 

<add key="ClientValidationEnabled" value="true" /> 

<add key="UnobtrusiveJavaScriptEnabled" value="true" /> 

</appSettings> 

</configuration> 

E: The jQuery validation plug-in takes advantage of the Data Annotation attributes defined in the model, which means that you need to do very little to start using it. 

Reference: ASP.NET MVC Client Side Validation 

http://www.codeproject.com/Articles/718004/ASP-NET-MVC-Client-Side-Validation 

START 70-486 EXAM