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.

Questions and Answers

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.)

A - Data caching

B - Page output caching with duration of two minutes

C - Page output caching with duration of four hours

D - Windows AppFabric caching

E - A, C and D

F - All of the above

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.

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.

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.

Answer : D

Explanation

D.Assembly Linker generates modules or resource files.

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();

C - FormsAuthentication.ClearAuthCookie

D - MembershipProvider.User =

E - A and B both

F - All of the above

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.)

A - ActiveDirectoryMembershipProvider

B - IIdentity

C - SqlMembershipProvider

D - Iprincipal

E - B and D both

F - All of the above

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.

B - Modify the Index method by changing its signature to the following: public ActionResult Index(Cart c)

C - Change the name of Index.aspx file to Cart.aspx

D - None of above

E - A and D both

F - All of the above

Answer : A

Explanation

A.Create a folder named Cart inside the Views folder.Move Index.aspx to the Cart folder.

Answer : D

Explanation

D.Partial views in mvc are the reusable views

mvc_framework_questions_answers.htm
Advertisements