- 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 are developing an application. One requirement is that part of your data access layer needs to be available to a third party, that wants to get this information from a REST URL in XML. Your company does not have experience with web services, but you have several websites running ASP.NET MVC 4. How could you design and provide these new services? (Choose all that apply.)
D - Create an ASP.NET ASMX services file to get, serialize, and return the data.
Answer : E
Explanation
E.Using ASP.NET MVC is another way to create a controller that will return XML.
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 - 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 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 are working on a AJAX-heavy site, and your script files are separated in your solution by function. You have already implemented minification and bundling, but you are still getting reports of poor performance when users try to access your pages. You cannot replicate the problem locally. What additional steps can you take and still provide the same user experience?
D - There is nothing more to do without redesigning the site.
Answer : C
Explanation
C.This is an appropriate next step to try to compress the script and style files being sent to the client.
Q 7 - What type of authentication accepts login credentials that will be checked against the domain or local server and are sent in a hashed format?
Answer : B
Explanation
B.Digest authentication is a challenge-response–based authentication method to ensure that user credentials are not sent over the network in clear text.
Q 8 - WIF enables you to create a custom token. To be able to use the token, you must create a custom token handler by overriding which of the following?
Answer : B
Explanation
B.SecurityTokenHandler is the appropriate class to override for creating a custom token handler
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 - The Controller class is responsible for the following processing stages:
A - Locating the appropriate action method to call and validating that it can be called.
B - Getting the values to use as the action method's arguments.
C - Handling all errors that might occur during the execution of the action method.
Answer : D
Explanation
D.All of the above.
To Continue Learning Please Login
Login with Google