- 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 - You are designing an application in which a section of the main page will be populated by content from a third-party provider. You do not have control over the responsiveness of the client or how much information will be returned with each request. The call is to a Restful service and will return the information formatted in Extensible Markup Language (XML). What is the best way to implement this application?
B - Put a synchronous service call into the main page controller.
Answer : A
Explanation
A.Because you do not have control over the responsiveness of the third- party provider and you do not know how much data might be returned from each call, you should wrap the call in the asynchronous framework. Providing the data in a strongly-typed model gives it more flexibility than working with the raw XML on the client side.
Q 2 - In an HTTP module, can you redirect the request to a different handler than is in the routing table? If so, what event would you handle?
A - Yes and you handle the PostAuthorizeRequest event.
C - Yes and you handle the MapRequestHandler event.
Answer : C
Explanation
C.You handle the mapping of the request in the MapRequestHandler.
Q 3 - In which of the following scenarios should you include validation? (Choose all that apply.)
Answer : F
Explanation
F.You should build in validation to check that at least one field has been populated before saving an entry.Although the partner company has not provided any requirements, your company is responsible for data entry and therefore should ensure that the data passing through the application meets some minimum criteria.The application has many entry fields so it is difficult to predict when an entry hits a valid stage. However, you already know you have constraints on the data being input because of the size of the database columns in which you will be storing them. A MaxLength validator on each field would help ensure that there is no loss of data.Although either field in the form can be anything, they should have a maximum length limit imposed so the data does not exceed the size of the database column they will be stored in. You should also validate that neither field is empty.
Q 4 - You are modifying an ASP.NET MVC web application for a client. The client requires that the application must be viewable on Android devices in a UI format native to the device. What should you do? (Choose all that apply.)
A - Run the Install-Package jQuery.Mobile.MVC command using the Package Manager console.
B - Create a viewport and use @media queries to make styles that are specific for Android.
C - Create corresponding mobile views for the project targeted toward Android.
D - Modify the Web.config file in Shared views in the project to add in support for other browsers.
Answer : C
Explanation
C. Text revealed by mouse-overs not being picked up by search engine crawlers indicates that content is being skipped
Q 5 - You have been tasked with modernizing an application created in ASP 3.0. Part of one of the pages contains HTML that comes as a string from a third-party application as part of a service call that populates part of a form. The same form contains input values for your application. You need to support the same business process as the original application, but you also want to use some MVC features. What is the approach?
Answer : D
Explanation
D.The key is separating your data input fields from the provided input fields. You can strongly-bind to yours because you have full control over the relationship between your model and your view, and can then use the ToValueProvider to merge the other model that is tied to the provided input fields.
Q 6 - Your application has an intermittent issue, based on the user's path through the application, in which the application seems to stop running. Even when running in debug mode, the application calls a web service and then stops. The application locks and the call never returns, thus the user's request is never completed and eventually times out. What performance or profiling tool will provide the most pertinent information about your application?
A - CPU sampling in the Performance Wizard
B - Memory allocation in the Performance Wizard
Answer : C
Explanation
C.Thread and resource profiling will give some understanding of what kind of actions are taking place that will cause a resource or thread to be blocked
Q 7 - You will be deploying your application in Windows Azure. You know that you need to include logging, but you have some concerns. What diagnostic capabilities can Windows Azure support? (Choose all that apply.)
C - The capability to retain logs from your custom logging solution when written to a local store
Answer : E
Explanation
E.You can control the diagnostics setting through configuration within your Windows Azure–hosted application.Although the Windows Azure VMs get recycled when the role restarts, saving the logs to the Windows Azure storage system outside of your VM would ensure that they are available.You can treat the Windows Azure diagnostics system like a traditional logging tool by writing messages to the system.
Q 8 - Why should you create a custom role provider? (Choose all that apply.)
A - To use a data source not regularly supported
B - To use the SimpleRoleProvider
C - To use a database design different than .NET provides
Answer : E
Explanation
E.Because traditional providers work only on SQL Server, accessing a differ- ent data provider such as MySQL would require a custom provider.Using a different database design would require that you create a custom provider.
Q 9 - What are the primary differences between the AntiXSS Library and the default .NET Framework? (Choose all that apply.)
B - The AntiXSS Library has be modified to realize performance gains.
D - The AntiXSS Library offers enhanced globalization capabilities.
Answer : E
Explanation
E.The AntiXSS Library is more performant than the traditional .NET Framework.AntiXSS takes an accepted-list approach, which means only those characters that have been approved are allowed through.AntiXSS was designed to allow additional support for globalization.
Q 10 - what is strongly typed view in mvc
A - view created with model class
B - view having same name as class
C - view created with strong keyword
Answer : A
Explanation
A.Strongly typed views are created with model class