- 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 creating an ASP.NET MVC 4 web application that will be accessed by a large number of traditional consumers. If you need to be able to access state information on the client side in JavaScript/jQuery, where can you store it? (Choose all that apply.)
Answer : E
Explanation
E.Query string information is available across all browsers and is usable on both the client and server.Cookies can be stored for a period of time on the client and be read from either client- or server-side operations.
Q 3 - You are creating an ASP.NET MVC web application. The application must accept user input for a ProductName field. To reduce delays due to invalid entries making round trips between the client and server, user input should be validated on the client before being submitted to the server. Which code segment should you choose?
A -
@Html.LabelFor(model ⇒ model.ProductName)
@Html.EditorFor(model ⇒ model.ProductName)
B -
@Html.LabelFor(model ⇒ model.ProductName)
@Html.ValidationMessageFor (model ⇒ model.ProductName)
C -
@Html.EditorFor(model ⇒ model.ProductName)@Html.ValidationMessageFor(model⇒model.ProductName)
Answer : C
Explanation
C.@Html.EditorFor, in combination with @Html.ValidationMessageFor, are used for client-side validation.
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 - You are creating an ASP.NET MVC website and you want to replace a <h2>hello</h2>tag within the view with custom resources you have created. What should you use?
A - <h2>@mvcapp.Resources.Home.Index.Heading</h2>
B - <h2div="resource">Hello</h2>
C - <h2 class="resource">Hello</h2>
Answer : A
Explanation
A.This is the correct way to insert resources into a view
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 - What do you need to do to use IntelliTrace from within Windows Azure? (Choose all that apply.)
A - Publish the solution from any version of Visual Studio Professional 2012 or higher.
B - Select the Enable IntelliTrace check box before publishing the solution.
D - Download and view the IntelliTrace logs through a web browser.
E - Download and view the IntelliTrace logs through Visual Studio Ultimate 2012.
Answer : F
Explanation
F.When publishing the projects, you can configure the process to deploy in debug mode with IntelliTrace enabled.You can view the IntelliTrace logs through Visual Studio after download.
Q 8 - What kind of helper methods does WebSecurity provide? (Choose all that apply.)
Answer : F
Explanation
F.Login is one of the methods provided by the WebSecurity helper.ResetPassword is one of the methods provided by the WebSecurity helper.CreateAccount is one of the methods provided by the WebSecurity helper.ChangePassword is one of the methods provided by the WebSecurity helper.
Q 9 - You are developing an ASP.NET MVC 2 application. A view contains a form that allows users to submit their first name. You need to display the value that is submitted, and you must ensure that your code avoids crosssite scripting. Which code segment should you use?
A - <% Response.Write(HttpUtility.HtmlDecode(Model.FirstName)) %>
Answer : B
Explanation
B.<%: Model.FirstName %> avoids cross site scripting
Q 10 - Where are routes registered in ASP.NET MVC Application?
Answer : C
Explanation
C.Routes are configured in Global.ascx in mvc
To Continue Learning Please Login
Login with Google