- MVC Framework - Home
- MVC Framework - Introduction
- MVC Framework - Architecture
- MVC Framework - ASP.NET Forms
- MVC Framework - First Application
- MVC Framework - Folders
- MVC Framework - Models
- MVC Framework - Controllers
- MVC Framework - Views
- MVC Framework - Layouts
- MVC Framework - Routing Engine
- MVC Framework - Action Filters
- Advanced Example
- MVC Framework - Ajax Support
- MVC Framework - Bundling
- Exception Handling
MVC Framework Online Quiz
Following quiz provides Multiple Choice Questions (MCQs) related to MVC Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.
Q 1 - You are designing an application that allows employees to change their human resources (HR) information, such as next of kin and direct deposit information. The requirements state that the application should talk directly to the HR systems database. However, at a recent company meeting, the CFO announced that the company will be converting to a new HR system over the next two years. They will take an additional year to move employees to the new system, one department at a time. How will this affect your design?
Answer : C
Explanation
C.Using the Repository pattern will give you a level of abstraction into the data layer. When you create the second data access component for the new HR system, you can then differentiate on a user or departmental level which implementation to use.
Q 2 - As you design a session-less state management system, what do you need to ensure that your application manages? (Choose all that apply.)
C - The session setting within the Web.config file
D - An identifier used by the server to identify the request
Answer : E
Explanation
E.Your application needs to manage whatever information might be re- quired to access the state management system.Your application needs to manage the passing of the identifier between requests.
Q 3 - You are designing a web application. You want to create a certain look and feel while reusing styles across pages as much as possible. How should you handle styles?
A - Use only one or two styles throughout your application to simplify maintenance.
B - Use a specific (unique) style for every element.
C - Use general styles for common elements and specific styles for elements that are unique.
Answer : C
Explanation
C.You should use general styles as much as possible. Achieving a certain look and feel means that you might have to create some specific styles, however.
Q 4 - You are creating a different view for each of several different browsers/devices, such as Home.iemobile.cshtml and Home.IPad.cshtml. What is the best way to implement it so your application knows to look for the specific views?
A - Use the viewport <meta> tag.
B - Add a new DisplayModeProvider for each of the special view types you want to support.
C - Put logic into each action to select the appropriate view based on information in the request.
Answer : B
Explanation
B.Adding a DisplayModeProvider for each type of special view, such as IEMobile or IPad, informs the framework to use those views where the context condition is fulfilled.
Q 5 - You are developing an ASP.NET MVC application and you need to create satellite assemblies from resource files. What code should you use?
A - mage.exe /n: /embed:strings.de-DE.resources MyApp.de-DE.resources.dll
B - WinRes.exe /t: embed:strings.de-DE.resources /culture:de-DE
C - Lc.exestrings.de-DE.resourcesMyApp.de-DE.resources.dll
D - al.exe /t:lib /embed:strings.de-DE.resources /culture:de-DE /out:MyApp.de-DE. resources.dll
Answer : D
Explanation
D.Assembly Linker generates modules or resource files.
Q 6 - You want to implement bundling and minification in your site. What are some of the potential problems you need to be aware of? (Choose all that apply.)
A - None; there is no condition in which this is a poor decision.
C - You should bundle and minimize scripts and CSS files together for maximum effectiveness.
D - Not bundling logically linked scripts together can have a negative effect on performance.
Answer : E
Explanation
E.Bundling every script into a single large file might decrease the effective- ness of concurrent downloading.Not separating scripts logically might lead to the user downloading scripts that will never be used. Although the download experience is maximized, it does not make sense to download unused scripts.
Q 7 - You want to configure Windows Azure diagnostics. Where do you configure the specific Performance Monitors you want to have run in support of your application?
Answer : C
Explanation
C.You configure specific monitors that will run in your application in the Diagnostics.wadcfg file.
Q 8 - WIF adds the concepts of claims to which of the following? (Choose all that apply.)
Answer : E
Explanation
E.The class implementing the IIdentity interface contains claims information. The class implementing the IPrincipal interface contains claims information.
Q 9 - You create an ASP.NET MVC 2 Web application that contains the following controller class.public class CartController : Controller { static List products = new List(); public ActionResult Index() { return View(); }}and the Views folder of your application, you add a view page named Index.aspx that includes the following @ Page directive.<%@ Page Inherits="System.Web.Mvc.ViewPage" %> You test the application with a browser. You receive the following error message when the Index method is invoked: "The view 'Index' or its master was not found." You need to resolve the error so that the new view is displayed when the Index method is invoked.What should you do?
A - Create a folder named Cart inside the Views folder.Move Index.aspx to the Cart folder.
Answer : A
Explanation
A.Create a folder named Cart inside the Views folder.Move Index.aspx to the Cart folder.
Q 10 - . How to return the JSON from action method in ASP.Net MVC?
Answer : A
Explanation
A.JSON are used to return JSON result in MVC