This document was ed by and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this report form. Report 3i3n4
1. view created with model class 2. view having same name as class 3. view created with strong keyword 4. view created with controller class
What are partial views in MVC
1. Its the resource file for a view 2. View that has strongly-type models 3. Same as MasterPage in asp.net 4. Reusable view
Where are routes ed in ASP.NET MVC Application?
1. Controller 2. Web.Config 3. Global.asax 4. None of the Above
which of the following represents RAZOR syntax?
1. ! 2. @ 3. <%: %> 4. )
_______ dictionary is used to share data between controller actions
1. Session 2. ViewData 3. ViewBag 4. TempData
What is the difference between “ActionResult” and “ViewResult”?
1. ViewResult performs an HTTP redirection to a specifed URL 2. ViewResult serializes a given ViewData object to JSON format 3. ActionResult is an abstract class while ViewResult derives from ActionResult class 4. ViewResult returns a file to the client, which is provided by a Stream while an ActionResult performs an HTTP redirection to a specifed URL
What is the correct order for the lifecycle of an ASP.NET MVC page
1. App initialization Locate and invoke controller action Routing Instantiate and render view Instantiate and execute controller 2. App initialization Locate and invoke controller action Routing Instantiate and execute controller Instantiate and render view 3. App initialization Routing Instantiate and execute controller Locate and invoke controller action Instantiate and render view 4. App initialization Instantiate and execute controller Routing Locate and invoke controller action Instantiate and render view
5. App initialization Instantiate and execute controller Locate and invoke controller action Routing Instantiate and render view
What are the 3 segments of the default route, that is present in an ASP.NET MVC application?
1. 1st Segment - Action Method Name 2nd Segment - Controller Name 3rd Segment - Parameter that is ed to the action method 2. 1st Segment - Action Method Name 2nd Segment - Parameter that is ed to the action method 3rd Segment - Controller Name 3. 1st Segment - Controller Name 2nd Segment - Action Method Name 3rd Segment - Parameter that is ed to the action method 4. 1st Segment - Parameter that is ed to the action method 2nd Segment - Action Method Name 3rd Segment - Controller Name
Is the following route definition a valid route definition? {controller}{action}/{id}
1. Yes 2. No
Can we map multiple URL’s to the same action
1. Yes 2. No
How can we navigate from one view to other view using hyperlink?
public ActionResult Index() { ViewBag.Message = “Welcome to ASP.NET MVC!”; return View(“~/Views/Example/Index.cshtml”); } Is the return View statement correct?
1. Yes 2. No
Is @Html.("txt") the same as
1. False 2. True
Where are the routing rules defined in an asp.net MVC application?
1. In Session_Start event in Global.asax 2. In Application_Start event in Global.asax 3. In the Web.Config under the <system.webServer> section 4. In the Web.Config under the <system.web.webPages.razor> section
By default, ASP.NET MVC looks for the View template file within the \Views\ [ControllerName]\ directory underneath the application.
1. True 2. False
The views for a ProductController reside in /Views/Product folder.
1. True 2. False
The ________ is entirely responsible for interpreting that request, manipulating the model if necessary, and then selecting a view to send back to the via the response.
1. Controller 2. View 3. Model
What container is ed between the controller and a view
Is ViewBag.Message equivalent to ViewData[“Message”].
1. Yes 2. No
@Html.TextBox("name", ViewBag.Name) Will this work
1. Yes 2. No
public class HomeController : Controller { public ActionResult Index() { ViewBag.Message = “Welcome to ASP.NET MVC!”; return View(); } }
1. the return will result in an error 2. /Views/Home/Index.cshtml is selected 3. /Views/Home/Home.cshtml is selected 4. /Views/Home/Default.cshtml is selected
Whats the difference between Html.Partial and Html.RenderPartial
1. The RenderPartial helper renders a partial view into a string. 2. The Partial helper renders a partial view into a string. 3. Partial writes directly to the response output stream instead of returning a string 4. RenderPartial writes directly to the response output stream instead of returning a string 5. 2 and 4
Can view data be accessed via the ViewBag property.
1. No 2. Yes
return View(); When the view name isn’t specified as shown below does it first look for a view with the same name as the action within the /Views/ControllerName directory?
1. True 2. False
The Controller is responsible for providing the interface (UI) to the .
1. True 2. False
By default, must all controller classes end with Controller e.g. ProductController
1. A set of classes that handles communication from the , overall application fl ow, and application-specifi c logic 2. Defi nes how the application’s interface (UI) will be displayed 3. A set of classes that describes the data you’re working with as well as the business rules for how the data can be changed and manipulated
Which one is a MVC view engine
1. Blade 2. Shaft 3. Razor 4. Edge
Which feature of ASP.NET MVC allows you to simply the ViewModel as a parameter to the action method without having to tear off the individual parameters from the Form?
1. Media Queries 2. Data Binding 3. Session 4. Model Binding
What are the advantages of ASP.NET MVC?
1. Extensive for TDD. With asp.net MVC, views can also be very easily unit tested. 2. Seperation of concerns. Different aspects of the application can be divided into Model, View and Controller. 3. ASP.NET MVC views are light weight, as they do not use viewstate. 4. It does not use view state on server-based forms which gives more control over the behavior of an application 5. answer 1,2,3,4
Is it possible to unit test an MVC application without running the controllers in an ASP.NET process?
1. Yes 2. No
Is it possible to share a view across multiple controllers?
1. Yes 2. No
How can we maintain session in MVC
1. tempdata 2. viewdata 3. viewbag 4. viewstate 5. 1,2 and 3 6. 2,3 and 4
ASP.NET MVC application, makes use of settings for routing to work correctly. Which file/s need to be altered for routing to work
1. Web.Config File 2. Global.asax File 3. Both 1 & 2 4. none of the above
Can we do validation in MVC using data annotations
1. Yes 2. No
Which of the below are return types of a controller action method
1. ViewResult 2. JavaScriptResult 3. RedirectResult 4. ContentResult 5. All the above
Can you point your browser to a view and have it render
1. Yes 2. No
Is there any way to handle variable number of segments in a route definition ?
1. No 2. controller/{action}/{*parametervalues} 3. controller/{action}/{?parametervalues} 4. controller/{action}/{ALLparametervalues}
Can can we plug an ASP.NET MVC into an existing ASP.NET application
1. Yes, no changes are needed 2. No 3. Yes, some modification is needed
Which method marks the specified key in a TempData dictionary for retention
In an ASP .Net MVC Application, browsers requests are mapped to?
1. Pages 2. Controller 3. Model 4. All of the above 5. None of the above
Not all views render HTML.
1. False 2. True
MVC stands for ______. 1. 2. 3. 4.
Model, Model, Model, Model,
Vision & Control View & Controller ViewData & Controller Data & Controller
Correct Answer: Model, View & Controller Which of following is TRUE? 1. 2. 3. 4.
The The The The
controller controller controller controller
redirects incoming request to model. executes an incoming request. controls the data. render html to view.
Correct Answer: The controller executes an incoming request. The model is a _______ . 1. 2. 3. 4.
Shape of data. Html content Collection of data Type of data.
Correct Answer: Shape of data. Which of the following is a type of view in MVC? 1. 2. 3. 4.
Partial view Executable view Data view Designer view
Correct Answer: Partial view Which of the following is TRUE? 1. 2. 3. 4.
Action Action Action Action
method method method method
can be static method in a controller class. can be private method in a controller class. can be protected method in a controller class. must be public method in a controller class.
Correct Answer: Action method must be public method in a controller class.
Which of the followings are ActionSelectors? 1. 2. 3. 4.
ActionName NonAction ActionVerbs All of the above
Correct Answer: All of the above Which is the default http method for an action method? 1. 2. 3. 4.
HttpPost HttpGet HttpPut HttpDelete
Correct Answer: HttpGet Which of the following view file types are ed in MVC? 1. 2. 3. 4.
.cshtml .vbhtml .aspx All of the above
Correct Answer: All of the above HtmlHelper class _________. 1. 2. 3. 4.
Generates Generates Generates Generates
html elements html view html help file model data
Correct Answer: Generates html elements ______ attributes can be used for data validation in MVC. 1. 2. 3. 4.
DataAnnotations Fluent API DataModel HtmlHelper
Correct Answer: DataAnnotations
Which of the following view contains common parts of UI? 1. 2. 3. 4.
Partial view Html View Layout view Razor view
Correct Answer: Layout view Which of the following methods are used to render partial view? 1. 2. 3. 4.
Html.Partial() Html.RenderPartial() Html.RenderAction() All of the above
Correct Answer: All of the above How to transfer data from controller to view? 1. 2. 3. 4.
Using model object Using ViewBag Using ViewData All of the above
Correct Answer: All of the above TempData is useful to _______. 1. 2. 3. 4.
Transfer data from view to controller Transfer data from one view to another view Transfer data from controller to controller Store data permanently.
Correct Answer: Transfer data from one view to another view What is action filters? 1. 2. 3. 4.
Action Action Action Action
filter filter filter filter
executes executes executes executes
before and after action method executes. before action method executes. after action method executes. parallel to action method.
Correct Answer: Action filter executes before and after action method executes.
Bundling allows __________. 1. 2. 3. 4.
Loading Loading Loading Loading
of of of of
multiple images in single request. multiple view files in single request. caching of multiple script files. multiple script files in single request.
Correct Answer: Loading of multiple script files in single request. Area allows us to ____________. 1. 2. 3. 4.
Partition large application into smaller units. Separate Mode, View and Controller folders. Partition View folder of large application into multiple view folders All of the above
Correct Answer: Partition large application into smaller units. Which of the following is a default route pattern in MVC? 1. 2. 3. 4.
Correct Answer: "{controller}/{action}/{id}" Which of the following default class is used to configure all the routes in MVC? 1. 2. 3. 4.
FilterConfig RouteConfig RouteConfig MVCRoutes
Correct Answer: RouteConfig Which of the following method of html helper generates html control based on the data type of specified property? 1. 2. 3. 4.
Html.TextBox Html. Html.Editor Html.Display
Correct Answer: Html.Editor
Related Documents 3h463d
Mvc Quiznetonline 1c46i
December 2019 48
Mvc opf
August 2022 0
Spring Mvc 4a577
February 2021 0
Fwformmodel Mvc y3r3q
August 2022 0
Asp Mvc t64
December 2020 0
Apostila Mvc 572j3
March 2021 0
More Documents from "surendhar" 703m37
Mvc Quiznetonline 1c46i
December 2019 48
Visual Merchandising 6s3i17
November 2019 52
Wrong Use Of Prepositions.docx 5m58
December 2019 45
Types Of Price Elasticity Of Demand 1p645j
December 2019 34
Ibm Employment Application Form V5.0 Wef 06aug2012 2i1r2y