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 creating an ASP.NET MVC 4 web application that will be accessed by a large number of traditional consumers. If you need to be able to access state information on the client side in JavaScript/jQuery, where can you store it? (Choose all that apply.)

A - LocalStorage

B - QueryString

C - ViewState

D - Cookies

E - B and D both

F - All of the above

Answer : E

Explanation

E.Query string information is available across all browsers and is usable on both the client and server.Cookies can be stored for a period of time on the client and be read from either client- or server-side operations.

Q 3 - You are creating an ASP.NET MVC web application. The application accepts phone number input through the applications form. When viewing the source from a browser, you find the following code:

PhoneNumber: <input id="text1" name="phoneNumber" size="10" type="text" value="" />
What Razor syntax code segment was used?

A - PhoneNumber: <input id="phoneNumber" name="phoneNumber" size="10" type="text" value="3125551212" />

B - @Html.EditorFor(model → model.PhoneNumber)

C - PhoneNumber: @Html.TextBox("phoneNumber", Request["phoneNumber"], new { @ placeholder = "3125551212"})

D - PhoneNumber: @Html.TextBox("phoneNumber", Request["phoneNumber"], new { size = 10 })

E - C and A both

F - All of the above

Answer : D

Explanation

D.This is the proper way to limit the size of a certain field that is being bound to the model.

Q 4 - You have been asked by the marketing department to help improve your company's ranking in search engine results. They are particularly concerned about a section of the site that is highly interactive, with extensive mouse-over color, background, and text changes. Without looking at the code, what is the most likely reason for ranking low in search engine results?

A - Unclosed HTML tags

B - Content hidden in JavaScript tags

C - Broken links

D - Excessive number of images

E - C and B both

F - All of the above

Answer : B

Explanation

B.Additional views must be created or ported to fit the smaller layout.

Q 5 - You are creating an ASP.NET MVC website and you want to replace a <h2>hello</h2>tag within the view with custom resources you have created. What should you use?

A - <h2>@mvcapp.Resources.Home.Index.Heading</h2>

B - <h2div="resource">Hello</h2>

C - <h2 class="resource">Hello</h2>

D - <h2>@mvcapp.Resources.Home.Index.HeadingHello</h2>

E - C and B both

F - All of the above

Answer : A

Explanation

A.This is the correct way to insert resources into a view

Answer : C

Explanation

C.This approach will give them an objective analysis of the amount of users a server can manage at a particular level of memory or CPU usage

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 - A SQL injection attack occurs when an application allows input submitted by the client to be run as part of a SQL command. What actions should a developer take to ensure that this doesn't happen? (Choose all that apply.)

A - Use Entity SQL because it does not suffer from the same risk.

B - Use SQLParameters to submit the parameters.

C - Use Linq-to-Entities to access the database,

D - Filter out keywords and symbols.

E - B and C both

F - All of the above

Answer : E

Explanation

E.Using SQLParameters is the best way to manage this risk.Linq-to-Entities uses an object model as access into the data layer, so the risk is mitigated.

Q 10 - Where are routes registered in ASP.NET MVC Application?

A - Controller

B - Web.config

C - Global.ascx

D - All of the above

E - C and D both

F - All of the above

Answer : C

Explanation

C.Routes are configured in Global.ascx in mvc

mvc_framework_questions_answers.htm
Advertisements