- 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 - 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 adding a reporting vertical to an enterprise application. Many of the reports will be run every morning by a set of users. Some of the reports will be identical as every member of a team will get the same report sometime in the morning. What kind of caching will provide an improvement in performance? (Choose all that apply.)
B - Page output caching with duration of two minutes
Answer : E
Explanation
E.Data caching with the appropriate timeout will enable the data needed for the reports to be stored so that the call to the database is not necessary.A page output caching of four hours caches the output of the report for the whole morning and should eliminate the need for the report to be run a second time.AppFabric caching acts much like data caching to eliminate the need for additional calls to the database to generate the reports.
Q 3 - What are compelling reasons to switch from static web content to dynamic web content? (Choose all that apply.)
A - The ability to substitute a new image for the company logo
B - The ability to display information from a database
C - The ability to link to other pages outside of your application
D - The ability to display information pertaining to the current user
Answer : E
Explanation
E.Displaying data from a database is an ideal reason to use a dynamic website.Personalization, or displaying information about the user on-screen, is an example of dynamic content.
Q 4 - What are common methods for detecting the type of browser running on a client? (Choose all that apply.)
A - Use JavaScript to query for the userAgent header.
B - Use the window.addEventListener method.
C - Use the viewport <meta> tag.
Answer : E
Explanation
E.Using JavaScript to query the userAgent gives you information about the type of browser being used by the client.The display mode provider performs some of the analysis of the HTTP request to try and determine what kind of browser made the request.
Q 5 - You are developing an ASP.NET MVC application and you need to create satellite assemblies from resource files. What code should you use?
A - mage.exe /n: /embed:strings.de-DE.resources MyApp.de-DE.resources.dll
B - WinRes.exe /t: embed:strings.de-DE.resources /culture:de-DE
C - Lc.exestrings.de-DE.resourcesMyApp.de-DE.resources.dll
D - al.exe /t:lib /embed:strings.de-DE.resources /culture:de-DE /out:MyApp.de-DE. resources.dll
Answer : D
Explanation
D.Assembly Linker generates modules or resource files.
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 - Forms authentication enables you to write code to validate user credentials. After it is complete, you can register the authentication cookies for use throughout the user's visit by using which of the following?
A - FormsAuthentication.SetAuthCookie
B - FormsAuthenticationCookie = new FormsAuthenicationCookie();
Answer : A
Explanation
A.FormsAuthentication.SetAuthCookie registers the authentication token in the cookie for use in future requests
Q 8 - What interfaces or classes should be implemented or inherited when creating custom authentication that is based on a non-Windows, third-party provider? (Choose all that apply.)
Answer : E
Explanation
E.IIdentity describes the user that was authenticated.IPrincipal provides the security context of the user on whose behalf the code is running.
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 - what are partialviews in mvc?
A - Its the resource file for a view
B - View that has strongly-type models
Answer : D
Explanation
D.Partial views in mvc are the reusable views
To Continue Learning Please Login
Login with Google