MCSD Developing ASP.NET MVC 4 Web Applications v1.0 (70-486)

Page:    1 / 16   
Total 233 questions

You are designing a distributed application.
The application must store a small amount of insecure global information that does not change frequently.
You need to configure the application to meet the requirements.
Which server-side state management option should you use? (Each correct answer presents a complete solution. Choose all that apply.)

  • A. Application state
  • B. Session state
  • C. Database support
  • D. Profile properties


Answer : AC

Explanation:
Application state is a data repository available to all classes in an ASP.NET application. Application state is stored in memory on the server and is faster than storing and retrieving information in a database. Unlike session state, which is specific to a single user session, application state applies to all users and all sessions. Therefore, application state is a useful place to store small amounts of often-used data that does not change from one user to another. The topics in this section provide information on how application state works and how to use it.
SQL Database provides a relational database management system for Windows Azure and is based on SQL Server technology. With a SQL Database instance, you can easily provision and deploy relational database solutions to the cloud, and take advantage of a distributed data center that provides enterprise-class availability, scalability, and security with the benefits of built-in data protection and self-healing.
References:
https://msdn.microsoft.com/en-us/library/azure/bf9xhdz4(v=vs.85).aspx

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


Answer : C

Explanation:
ASP.NET session state service provides a somewhat slower service than the in-process variant as we need to make calls to a remote server. All session data is stored in memory so shutting down the state machine will wipe out all session data as well.
References:
https://dotnetcodr.com/2013/07/01/web-farms-in-net-and-iis-part-5-session-state-management/

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 : B

Explanation:

HOTSPOT -
You are developing an ASP.NET MVC web application that enables users to open Microsoft Excel files.
The current implementation of the ExcelResult class is as follows.


You need to enable users to open Excel files.
How should you implement the ExecuteResult method? (To answer, select the appropriate options in the answer area.)
Hot Area:



Answer :

Explanation:
Target 1:

Name: AcceptTypes -
Synopsis: stringArray = Request.AcceptTypes
Returns a String array containing theMultipurpose Internet Mail Extension (MIME) types accepted by the client. You can use this property to determine whether a client can accept certain response types, including application types such as Word or Excel, which are supported only by Internet Explorer.
Target 2, Target 3:
Example: Response.AddHeader("content-disposition", "attachment; filename=MyExcelFile.xls"); Response.ContentType = "application/ms-excel";
Reference: Export data to Excel file with ASP.NET MVC 4 C# is rendering into view http://stackoverflow.com/questions/16346227/export-data-to-excel-file-with-asp-net-mvc-4-c-sharp-is-rendering-into-view

You are designing an HTML5 website.
You need to design the interface such that the content is viewable in all types of browsers, including screen readers.
What should you do? (Each correct answer presents a complete solution. Choose all that apply.)

  • A. Ensure that content elements have valid and descriptive names.
  • B. Use Resource Description Framework (RDF) to describe content elements.
  • C. Convert HTML forms to XForms.
  • D. Use HTML5 semantic markup elements.
  • E. Annotate content elements with Accessible Rich Internet Application (ARIA) attributes.


Answer : DE

Explanation:

You are developing an ASP.NET MVC application in Visual Studio. The application supports multiple cultures.
The application contains three resource files in the Resources directory:
-> ProductDictionary.resx
-> ProductDictionary.es.resx
-> ProductDictionary.fr.resx
Each file contains a public resource named Currency with the localized currency symbol. 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.LocalizedCurrency to the localized currency contained in the resource files.
Which code segment should you add to the action at line 03?

  • A. ViewBag.LocaIizedCurrency = Resources.ProductDictionary.Currency;
  • B. ViewBag.LocalizedCurrency = HttpContext.GetGlobalResourceObject("ProductDictionary", "Currency", new System.Globalization.CultureInfo(en"));
  • C. ViewBag.LocalizedCurrency = HttpContext.GetLocalResourceObject("ProductDictionary","Currency");
  • D. ViewBag.LocalizedCurrency = HttpContext.GetGlobalResourceObject("ProductDictionary", "Currency");


Answer : A

Explanation:
Only the Resources class is used.

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. Aspnet_regbrowsers.exe
  • C. Aspnet_setreg.exe
  • D. Aspnet_compiler.exe


Answer : A

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

You are developing an ASP.NET MVC web application that includes the following method.


You need to test the GoldMined method.
Which unit test should you use?

  • A. Option A
  • B. Option B
  • C. Option C
  • D. Option D


Answer : D

Explanation:

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. From the Debug menu in Visual Studio, select Exceptions. Enable the Thrown check box for Common Language Runtime Exceptions.
  • B. From the DEBUG menu in Visual Studio, select Attach to Process. Select the IIS process.
  • C. From the Debug menu in Visual Studio, select Exceptions. Disable the User-unhandled check box for Common Language Runtime Exceptions.
  • D. From the TOOLS menu in Visual Studio, click Customize. Click the Command tab and select Debug.


Answer : A

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

You are developing an ASP.NET MVC web application for viewing a photo album. The application is designed for devices that support changes in orientation, such as tablets and smartphones. The application displays a grid of photos in portrait mode.
When the orientation changes to landscape, each tile in the grid expands to include a description. The HTML that creates the gallery interface resembles the following markup.


If this CSS is omitted, the existing CSS displays the tiles in landscape mode.
You need to update the portrait mode CSS to apply only to screens with a width less than 500 pixels.
Which code segment should you use?

  • A. @media resolution(max-width: 500px) {. . .}
  • B. @media screen(min-width: Opx, max-width: 500px) {. . .}
  • C. @media screen and (width <= 500px) {. . .}
  • D. @media screen and (max-width: 500px) {. . .}


Answer : D

Explanation:
Screen is used for computer screens, tablets, smart-phones etc. max-width is the maximum width of the display area, suchas a browser window.
References:
http://www.w3schools.com/cssref/css3_pr_mediaquery.asp

You are designing a distributed banking application that handles multiple customers. A user may log on to the site to perform activities such as checking balances, performing transactions, and other activities that must be done securely.
The application must store secure information that is specific to an individual user. The data must be automatically and securely purged when the user logs off.
You need to save transient information in a secure data store.
Which data store should you use?

  • A. NET session state
  • B. NET profile properties
  • C. NET application state
  • D. Shared database


Answer : A

Explanation:
ASP.NET session state enables you to store and retrieve values for a user as the user navigates ASP.NET pages in a Web application. HTTP is a stateless protocol. This means that a Web server treats each HTTP request for a page as an independent request. The server retains no knowledge of variable values that were used during previous requests. ASP.NET session state identifies requests from the same browser during a limited time window as a session, and provides a way to persist variable values for the duration of that session.
References:
https://msdn.microsoft.com/en-us/library/ms178581.aspx

You are developing an application that supports multiple cultures.
The application must store localized content in satellite assemblies.
You need to build the satellite assemblies.
Which tool should you use?

  • A. Gacutil.exe
  • B. Al.exe
  • C. Ildasm.exe
  • D. Ilasm.exe


Answer : B

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
References:
https://technet.microsoft.com/en-us/library/21a15yht(v=vs.85)

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 : A

Explanation:
The Manifest Generation and Editing Tool (Mage.exe) is a command-line tool that supports the creation and editing of application and deployment manifests.
Incorrect:
Not B: The Native Image Generator (Ngen.exe) is a tool that improves the performance of managed applications. Ngen.exe creates native images
Not C: Al.exe generates a file with an assembly manifest, not an deployment manifest, from one or more files that are either resource files or Microsoft intermediate language (MSIL) files.
Not D: Resgen.exe, the Resource File Generator, converts text (.txt or .restext) files and XML-based resource format (.resx) files to common language runtime binary (.resources) files that can be embedded in a runtime binary executable or compiled into satellite assemblies.
References:
http://www.devcurry.com/2011/02/important-net-framework-40-command-line.html

DRAG DROP -
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.)
Select and Place:




Answer :

You are developing an ASP.NET MVC application.
The application provides a RESTful API for third-party applications. This API updates the information for a contact by embedding the information in the URL of an
HTTP POST.
You need to save the Contact type when third-party applications use the EditContact method.
Which code segment should you use? {Each correct answer presents a complete solution. Choose all that apply.)


  • A. Option A
  • B. Option B
  • C. Option C
  • D. Option D


Answer : BC

Explanation:
Basics of RESTful services:
REST stands for Representational State Transfer, it is a simple stateless architecture that runs over HTTPwhere each unique URL is representation of some resource. There are four basic design principles which should be followed when creating RESTful service:
-> Use HTTP methods (verbs) explicitly and in consistent way to interact with resources (Uniform Interface), i.e. to retrieve a resource use GET, to create a resource use POST, to update a resource use PUT/PATCH, and to remove a resource use DELETE.
Etc.

Page:    1 / 16   
Total 233 questions