- 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
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 - How could you traditionally consume an ASMX web service from your application? (Choose all that apply.)
A - Generate a proxy by selecting Add Reference in Visual Studio.
B - Create an HttpService and connect using Get (URL).
C - Generate a proxy by selecting Add a Service Reference in Visual Studio.
Answer : E
Explanation
E.HttpService.Get gets the output of a REST service.Visual Studio creates a proxy for you from the WSDL at the site you select.
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 accepts phone number input through the applications form. When viewing the source from a browser, you find the following code:
PhoneNumber: <input id="text1" name="phoneNumber" size="10" type="text" value="" />What Razor syntax code segment was used?
B - @Html.EditorFor(model → model.PhoneNumber)
D - PhoneNumber: @Html.TextBox("phoneNumber", Request["phoneNumber"], new { size = 10 })
Answer : D
Explanation
D.This is the proper way to limit the size of a certain field that is being bound to the model.
Q 4 - You have been asked by the marketing department to help improve your company's ranking in search engine results. They are particularly concerned about a section of the site that is highly interactive, with extensive mouse-over color, background, and text changes. Without looking at the code, what is the most likely reason for ranking low in search engine results?
B - Content hidden in JavaScript tags
Answer : B
Explanation
B.Additional views must be created or ported to fit the smaller layout.
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 - What is an advantage to using first chance exception notification?
A - The ability to capture and handle all exceptions that occur within the application in one place
B - The ability to log an exception after it is handled by its appropriate error handling code
C - The ability to log an exception before it is touched by any other error handler
Answer : C
Explanation
C.The first chance exception handler enables you to examine an exception and take some action before it is touched by any other handler
Q 7 - You support hardware purchasing for an ASP.NET MVC application in your company. The application is finished, and the development team knows the number of intended users. Which approach will give the team the best understanding of the application's hardware needs?
Answer : C
Explanation
C.This approach will give them an objective analysis of the amount of users a server can manage at a particular level of memory or CPU usage
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 - A SQL injection attack occurs when an application allows input submitted by the client to be run as part of a SQL command. What actions should a developer take to ensure that this doesn't happen? (Choose all that apply.)
A - Use Entity SQL because it does not suffer from the same risk.
B - Use SQLParameters to submit the parameters.
C - Use Linq-to-Entities to access the database,
Answer : E
Explanation
E.Using SQLParameters is the best way to manage this risk.Linq-to-Entities uses an object model as access into the data layer, so the risk is mitigated.
Q 10 - Where are routes registered in ASP.NET MVC Application?
Answer : C
Explanation
C.Routes are configured in Global.ascx in mvc