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

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

A - Task an individual on staff to learn WCF, and have this individual develops and deploys these new services using WCF.

B - Use the Web API to create REST services using ApiController in which the serialization type is defined by the Accepts property of the browser.

C - Build a basic ASP.NET MVC 4 project in which the view simply passes through the information provided by the controller, and the controller manages the code for serializing the response.

D - Create an ASP.NET ASMX services file to get, serialize, and return the data.

E - B,C and D

F - All of the above

Answer : E

Explanation

E.Using ASP.NET MVC is another way to create a controller that will return XML.

Answer : B

Explanation

B.The first request to open a WebSocket connection is a standard HTTP GET. After the request is received, the browser sends a separate upgrade request

Q 3 - You are creating an ASP.NET MVC web application. Within the application, you have created a partial view for contact email and phone number. Which code segment should you use to display the partial view on the main page?

A - @Html.ActionLink("ContactPartial")

B - @Html.Partial("ContactPartial")

C - @RenderPage("ContactPartial")

D - @RenderBody()

E - C and A both

F - All of the above

Answer : B

Explanation

B.@Html.Partial loads a partial view.

Q 4 - You have been asked by a company to evaluate its web application as a user. The company wants you to review the website from outside its network and identify areas that might be problematic. You have been asked to consider SEO and accessibility. Which tools would be helpful for your review? (Choose all that apply.)

A - IIS SEO Toolkit

B - Internet Explorer F12 tools

C - IIS Logging tab

D - Bing Webmaster Toolkit

E - C and A both

F - All of the above

Answer : B

Explanation

B.The Internet Explorer F12 tool enables you view HTML and CSS code, which can help you detect structural problems or errors that might affect acces- sibility or SEO.

Answer : A

Explanation

A.The FileResult property was designed for this need.

Q 6 - You are re-creating an application that was originally built with ASP 2.0. You need to break the monolithic application into a traditional three-tier application. One of the requirements is that database errors must be displayed in the UI. Which solution will present enough information to the user so they can notify the appropriate person of a problem, but not allow the user to gain information about the design of the database?

A - Add a first chance exception handler and log the information in the error.

B - Add a generic database-layer exception handler to the business layer, and pass appropriate error information to the UI layer for display in a custom error page.

C - Add specific database exception handlers in the business layer and log the information into the database for further review.

D - Let the errors pass through the business layer to the UI layer where they can be handled as specific errors and presented as appropriate in the UI.

E - A and D both

F - All of the above

Answer : B

Explanation

B.The business layer is the appropriate place to manage data layer excep- tions. By repackaging it and sending it up to the user layer, you can maintain separation of concerns and meet the requirement to display information to the user. This will also enable you to log the information as necessary to support de- bugging.

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 - 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?

A - SecurityToken

B - SecurityTokenHandler

C - SWTToken

D - Saml2SecurityTokenHandler

E - A and B both

F - All of the above

Answer : B

Explanation

B.SecurityTokenHandler is the appropriate class to override for creating a custom token handler

Q 9 - If you have View with @Page directive to inherit from ViewPage<TModel> then your View is_________.(where TModel is type of Model)

A - Partial View

B - Strongly Typed View

C - Content View

D - Template View

E - A and D both

F - All of the above

Answer : B

Explanation

B.Strongly typed views are bound to the model

Q 10 - Which of the following represents razor syntax?

A - !

B - @

C - <%-%>

D - )

E - C and D both

F - All of the above

Answer : B

Explanation

B.Razar syntax starts with @

mvc_framework_questions_answers.htm
Advertisements