Vous êtes sur la page 1sur 3

Which of following is TRUE?

A. The controller redirects incoming request to model.

B. The controller executes an incoming request.

C. The controller controls the data.

D. The controller render html to view.

The model is a _______ .

A. Shape of data.

B. Html content

C. Collection of data

D. Type of data.

Which of the following is TRUE?

A. Action method can be static method in a controller class.

B. Action method can be private method in a controller class.

C. Action method can be protected method in a controller class.

D. Action method must be public method in a controller class.

Which of the followings are ActionSelectors?

A. ActionName

B. NonAction

C. ActionVerbs

D. All of the above

Which is the default http method for an action method?

A. HttpPost

B. HttpGet

C. HttpPut

D. HttpDelete

Which of the following view file types are supported in MVC?

A. .cshtml

B. .vbhtml

C. .aspx
D. All of the above

HtmlHelper class _________.

A. Generates html elements

B. Generates html view

C. Generates html help file

D. Generates model data

Which of the following view contains common parts of UI?

A. Partial view

B. Html View

C. Layout view

D. Razor view

How to transfer data from controller to view?

A. Using model object

B. Using ViewBag

C. Using ViewData

D. All of the above

Which of the following is a default route pattern in MVC?

A. "/{action}/{controller}/{id}"

B. "{controller}/{id}"

C. "{controller}/{action}/{id}"

D. "{controller}/{action}”

Which of the following default class is used to configure all the routes in MVC?

A. FilterConfig

B. RegisterRouteConfig

C. RouteConfig

D. MVCRoutes
13. What is the extension of MVC view when using C#?
A) cshtml
B) vbhtml
C) None
D) Both A & B

In MVC, the Controller is responsible for taking the end user request and loading the
appropriate Model and View.
 True
 False

8. The “Route” attribute is used to define the URL structure.


 True
 False

In the below code the “GotoHome” action is decorated with the route attribute. The route
attribute says that the “GotoHome” can be invoked using the URL structure “Users/home”.
public class HomeController : Controller
{
[Route("Users/home")]
public ActionResult GotoHome()
{
return View();
}
}
 True
 False

10. What is View Bag?


 Helps to maintain data when you move from one controller to another controller or from one
action to another action.
 Helps to maintain data when you move from controller to view.
 It’s a dynamic wrapper around view data.
 None of Above.

Vous aimerez peut-être aussi