Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
4. Reusable view
1. Controller
2. Web.Config
3. Global.asax
1. !
2. @
3. <%: %>
4. )
1. Session
2. ViewData
3. ViewBag
4. TempData
What is the difference between “ActionResult” and “ViewResult”?
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
1. ViewResult
2. JsonResult
3. RedirectResult
4. EmptyResult
5. XMLResult
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. Yes
2. No
1. Yes
2. No
How can we navigate from one view to other view using hyperlink?
1. TransferLink
2. RedirectLink
3. ActionLink
4. ExecuteLink
public ActionResult Index() {
ViewBag.Message = “Welcome to ASP.NET MVC!”;
return View(“~/Views/Example/Index.cshtml”);
}
1. Yes
2. No
1. False
2. True
By default, ASP.NET MVC looks for the View template file within the \Views\
[ControllerName]\ directory underneath the application.
1. True
2. False
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 user via the response.
1. Controller
2. View
3. Model
1. ControllerViewDictionary
2. ViewDataDictionary
3. ModelDataDictionary
1. Yes
2. No
@Html.TextBox("name", ViewBag.Name)
1. Yes
2. No
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
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
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 user interface (UI) to the user.
1. True
2. False
1. No
2. Yes
MVC stands for
1. Multiverse-Virtual-Controller
2. Model-View-Controller
3. Master-Value-Construct
4. Mobile-Virtual-Controller
The Model is
1. A set of classes that handles communication from the user, overall application
fl ow, and application-specifi c logic
2. Defi nes how the application’s user 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
1. Blade
2. Shaft
3. Razor
4. Edge
Which feature of ASP.NET MVC allows you to simply pass 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 support 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
1. Yes
2. No
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
1. Yes
2. No
1. ViewResult
2. JavaScriptResult
3. RedirectResult
4. ContentResult
1. Yes
2. No
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
2. No
Which method marks the specified key in a TempData dictionary for retention
1. TempData.Revive()
2. TempData.Alive()
3. TempData.Increase()
4. TempData.Load()
5. TempData.Store()
6. TempData.Keep()
1. Pages
2. Controller
3. Model
1. False
2. True
MVC stands for ______.
1. Shape of data.
2. Html content
3. Collection of data
4. Type of data.
1. Partial view
2. Executable view
3. Data view
4. Designer view
1. ActionName
2. NonAction
3. ActionVerbs
4. All of the above
1. HttpPost
2. HttpGet
3. HttpPut
4. HttpDelete
1. .cshtml
2. .vbhtml
3. .aspx
4. All of the above
1. DataAnnotations
2. Fluent API
3. DataModel
4. HtmlHelper
1. Partial view
2. Html View
3. Layout view
4. Razor view
1. Html.Partial()
2. Html.RenderPartial()
3. Html.RenderAction()
4. All of the above
Correct Answer: Action filter executes before and after action method
executes.
Bundling allows __________.
1. "/{action}/{controller}/{id}"
2. "{controller}/{id}"
3. "{controller}/{action}/{id}"
4. "{controller}/{action}”
Which of the following default class is used to configure all the routes in MVC?
1. FilterConfig
2. RegisterRouteConfig
3. RouteConfig
4. MVCRoutes
Which of the following method of html helper generates html control based on
the data type of specified property?
1. Html.TextBox
2. Html.Password
3. Html.Editor
4. Html.Display