MVC Framework Online Quiz


Advertisements


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

Q 1 - AppCmd.exe is an application that helps you work with which objects? (Choose all that apply.)

A - Site

B - Users

C - Config

D - App

E - A, D and E

F - All of the above

Answer : E

Explanation

E.AppCmd.exe enables the configuration of virtual sites.AppCmd.exe supports the administration of general configuration sections.AppCmd.exe manages the support of applications.

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 : 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 are developing an ASP.NET MVC application. You have a set of requirements to create a help section for remote users. Your typical help scheme is help/desktop or help/mobile, so logically this section should be help/remote. The change board wants the links in the application to point to the default support site. Which code segment would you use?

A - routes.MapRoute(name: "Default",url: "{controller}/{action}/{id}", defaults: new { controller = "Home",action = "Index", id = UrlParameter.Optional });

B - routes.MapRoute( "remote", "help/remote",new { controller = "support", action = "Index" });

C - routes.MapRoute( "remote", "help",new { controller = "support", action = "Index" });

D - routes.MapRoute( "remote", "remote/help",new { controller = "support", action = "Index" });

E - C and C both

F - All of the above

Answer : B

Explanation

B.This is how you add an additional route and point to a different controller.

Answer : E

Explanation

E.Creating a globally applied action filter enables you to save the state of every action taken by the user while logged in to your site.By creating a globally applied action filter you have ensured that every action taken by the user will be logged.

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 are implementing an ASP.NET MVC 2 Web application. The URL with path /Home/Details/{country} will return a page that provides information about the named country. You need to ensure that requests for this URL that contains an unrecognized country value will not be processed by the Details action of HomeController.What should you do?

A - Add the ValidateAntiForgeryToken attribute to the Details action method.

B - Add the Bind attribute to the country parameter of the Details action method. Set the attribute's Prefix property to Country.

C - Create a class that implements the IRouteConstraint interface. Configure the default route to use this class.

D - Create a class that implements the IRouteHandler interface. Configure the default route to use this class.

E - A and D both

F - All of the above

Answer : C

Explanation

C.IrouteConstraint interface is implemented to configure default route to implement custom logic

Answer : A

Explanation

A.Strongly typed views are created with model class


mvc_framework_questions_answers.htm

Advertisements