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

Answer : C

Explanation

C.You handle the mapping of the request in the MapRequestHandler.

Q 3 - You are creating an ASP.NET MVC web application. The application must accept user input for a ProductName field. To reduce delays due to invalid entries making round trips between the client and server, user input should be validated on the client before being submitted to the server. Which code segment should you choose?

A -

@Html.LabelFor(model ⇒ model.ProductName)
@Html.EditorFor(model ⇒ model.ProductName)

B -

@Html.LabelFor(model ⇒ model.ProductName)
@Html.ValidationMessageFor (model ⇒ model.ProductName)

C -

@Html.EditorFor(model ⇒ model.ProductName)@Html.ValidationMessageFor(model⇒model.ProductName)

D -

@Html.LabelFor(model ⇒ model.ProductName)

E - C and A both

F - All of the above

Answer : C

Explanation

[email protected], in combination with @Html.ValidationMessageFor, are used for client-side validation.

Answer : E

Explanation

E.This installs all the necessary mobile packages.All mobile views and mobile master layout ensure that the page will load accordingly.

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 - You want to configure Windows Azure diagnostics. Where do you configure the specific Performance Monitors you want to have run in support of your application?

A - ServiceDefinition.csdef

B - ServiceConfiguration.cscfg

C - Diagnostics.wadcfg

D - Web.config

E - A and B both

F - All of the above

Answer : C

Explanation

C.You configure specific monitors that will run in your application in the Diagnostics.wadcfg file.

Q 8 - Which methods help the RoleProvider determine whether a user is assigned a role or set of roles? (Choose all that apply.)

A - GetRoles

B - GetRolesForUser

C - IsUserInRole

D - FindUsersInRole

E - B and C both

F - All of the above

Answer : E

Explanation

E.GetRolesForUser gets a list of roles for a user.IsUserInRole returns a Boolean on whether a particular user has a role

Q 9 - You are writing an action method called AddProduct inside the Product controller. The logic in your code indicates that you need to call the Cart controller's Add method as a result of your controller's action method. Which line of code would accomplish this?

A - return Content("Cart.Add")

B - Response.Redirect("Cart.aspx?Add")

C - return redirect("Cart/Add")

D - return View("Cart.Add")

E - A and D both

F - All of the above

Answer : C

Explanation

C.This will redirect to the Add method of Cart controller

Q 10 - Which Helper Method is used to return a user-defined content type.

A - Content

B - JavaScript

C - View

D - RedirectToRoute

E - A and D both

F - All of the above

Answer : A

Explanation

A.Content Helper Method is used to return a user-defined content type.


mvc_framework_questions_answers.htm

Advertisements