- 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 - You have been given requirements for a dashboard page that will contain summary information from your order processing system in a single display table. However, this summarization needs to be done by combining data requests from the order system, the shipping system, and the accounting system. The dashboard page will be the only place you use this combined data. What is the best way to implement this requirement?
A - Make the various data requests and compile the information in the controller for display.
Answer : B
Explanation
B.You will have a better chance of code reuse if you break down the separate calls into their own models and then create another model to pull them together and compile them.
Q 2 - You are designing an ASP.NET MVC 4 application that uses an Oracle database for persistence. What session configuration choices enable you to deploy your application on a web farm? (Choose all that apply.)
Answer : E
Explanation
E.Using a shared state server across the web farm is an available option. Using a state server designates one server to maintain state for all the servers that connect to it.A custom session provider enables you to maintain state as necessary by doing the work in your custom code. It is generally used when you try to use a dif- ferent RDBMS system or when you do not want to use the default session database design.
Q 3 - What is the best way to intercept every request for an image on your site and ensure that a watermark is added to the image?
A - An HTTP module handling the AuthorizeRequest event
B - A custom HTTP handler set to handle .htm and .html pages
C - A custom HTTP handler configured to serve .png and .jpg files
D - An HTTP module handling the PostRequestHandlerExecute event
Answer : C
Explanation
C.Intercepting every request for .jpg and .png files is the easiest way to consistently add watermarks to the images.
Q 4 - You are modifying an ASP.NET MVC web application and you have created a new master layout page named _Layout.WindowsPhone.cshtml. You want to use that layout in a new view. Which code segment do you use?
A - @Html.ActionLink("_Layout.WindowsPhone.cshtml");
B - Layout="~/Views/Shared/_Layout.WindowsPhone.cshtml";
C - Layout="Layout.WindowsPhone.cshtml";
Answer : B
Explanation
B.Layout="" loads the layout file to be used with that view.
Q 5 - Your application manages the sale of expensive well-drilling equipment. Your IT director wants you to add functionality that sends an email to a customer's sales account manager whenever someone from your client company logs in to the system. What is an appropriate solution?
Answer : D
Explanation
D.This is be applied only because the user is leaving the login section of the application, at which point you also know whether they have been authenticated
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 - Using custom error pages provides a lot of flexibility to an application because it allows for a consistent user experience even when the application has a problem. To take full advantage of this flexibility, you need to be able to create the pages and configure the application to use these pages. What code will provide custom error pages for 404 errors and general exceptions?
Answer : B
Explanation
B.This example shows the 404 error status and it sets the default error han- dler to the server error action
Q 8 - What attribute or code snippet within a controller enables a role named Admin to access actions or code blocks after the check-in code?
A - RoleProvider.GetRolesForUser("Admin")
B - [Authorize(Roles="Admin")]
C - RoleProvider.IsUserInRole(User.Name)
Answer : B
Explanation
B.The Authorize attribute handles authorization on a controller and/or action basis by using the Roles= qualifier
Q 9 - You are implementing an ASP.NET MVC 2 Web application. The URL with path /Home/Details/{country} will return a page that provides information about the named country. You need to ensure that requests for this URL that contains an unrecognized country value will not be processed by the Details action of HomeController.What should you do?
A - Add the ValidateAntiForgeryToken attribute to the Details action method.
Answer : C
Explanation
C.IrouteConstraint interface is implemented to configure default route to implement custom logic
Q 10 - Which of the following represents razor syntax?
Answer : B
Explanation
B.Razar syntax starts with @
To Continue Learning Please Login
Login with Google