- MVC Framework Tutorial
- 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 Useful Resources
- Questions & Answers
- MVC Framework - Quick Guide
- MVC Framework - Resources
- MVC Framework - Discussion
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 - AppCmd.exe is an application that helps you work with which objects? (Choose all that apply.)
Answer : E
Explanation
E.AppCmd.exe enables the configuration of virtual sites.AppCmd.exe supports the administration of general configuration sections.AppCmd.exe manages the support of applications.
Q 2 - You are building an application in which you want to display updated information to a website every 15 minutes. What are efficient ways to manage the update? (Choose all that apply.)
B - HTTP polling with 1-minute intervals
Answer : E
Explanation
E.WebSockets can be used to pass information between the client and server.HTTP polling with 15-minute intervals is a valid way to get the informa- tion within the required time frame.
Q 3 - You are creating an ASP.NET MVC web application. Within the application, you have created a partial view for contact email and phone number. Which code segment should you use to display the partial view on the main page?
A - @Html.ActionLink("ContactPartial")
B - @Html.Partial("ContactPartial")
Answer : B
Explanation
B.@Html.Partial loads a partial view.
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 globalizing an application and are compiling a list of items that need to be translated. Which items should be included on the list? (Choose all that apply.)
A - Images that are used as part of the menu structure
Answer : E
Explanation
E. Images that are being used for menus likely have text displayed on them. That text should be localized, and extra sets of buttons might have to be created.Tooltips are supposed to give extra contextual help about the item the mouse hovers over. It is important to get them translated.
Q 6 - You inherited a working application that began as a proof of concept but was eventually adopted as a production application without being refactored. Many new requirements need to be added. As part of your initial analysis, you notice a lot of problems with bad data. Which solutions will help remediate this issue? (Choose all that apply.)
A - Running the Performance Wizard to sample CPU usage
B - Adding code contracts to ensure that the input parameters have expected values
C - Adding code contracts to ensure that the return values meet specific criteria
D - Adding code contracts to ensure that objects do not become invalid during process
E - Running the Visual Studio profiler to analyze application flow
Answer : F
Explanation
F.Preconditional code contracts ensure that incorrect information is not submitted to a method. This helps eliminate the possibility of bad data.Postconditional code contracts ensure that incorrect information is not returned from a method. This helps eliminate the possibility of bad data.Invariant code contracts ensure that objects do not get to an invalid state. This helps eliminate the possibility of bad data.
Q 7 - You are under contract with a large company that is starting to implement a TDD approach. As part of the long-term support for this effort, the company needs you to complete several unit tests. As you review the current code base, you find good tests for the model, but no tests for anything other than the model. Which of the following is the best approach to complete the unit tests?
Answer : D
Explanation
D.This solution provides for testing actions and nonactions as well as a good split of the tests per file.
Q 8 - Which methods help the RoleProvider determine whether a user is assigned a role or set of roles? (Choose all that apply.)
Answer : E
Explanation
E.GetRolesForUser gets a list of roles for a user.IsUserInRole returns a Boolean on whether a particular user has a role
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 - Which Helper Method Returns binary output to write to the response?
Answer : B
Explanation
B.File Helper Method Returns binary output to write to the response
To Continue Learning Please Login
Login with Google