ASP.NET MVC 4 Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

In asp.net mvc 4 what does Content() helper method return

A

Returns a ContentResult that renders arbitrary text, e.g., “Hello, world!”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

In asp.net mvc 4 what does File() helper method return

A

Returns a FileResult that renders the contents of a file, e.g., a PDF.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

In asp.net mvc 4 what does HttpNotFound() helper method return

A

Returns an HttpNotFoundResult that renders a 404 HTTP status code response.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

In asp.net mvc 4 what does JavaScript():: helper method return

A

that renders JavaScript, e.g., “function hello() { alert(Hello, World!); }”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

In asp.net mvc 4 what does Json() helper method return

A

Returns a JsonResult that serializes an object and renders it in JavaScript Object
Notation (JSON) format, e.g., “{ “Message”: Hello, World! }”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

In asp.net mvc 4 what does PartialView() helper method return

A

Returns a PartialViewResult that renders only the content of a view (i.e., a view
without its layout).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

In asp.net mvc 4 what does Redirect() helper method return

A

Returns a RedirectResult that renders a 302 (temporary) status code to redirect
the user to a given URL, e.g., “302 http://www.ebuy.com/auctions/recent”. This
method has a sibling, RedirectPermanent(), that also returns a RedirectResult, but
uses HTTP status code 301 to indicate a permanent redirect rather than a temporary
one.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

In asp.net mvc 4 what does View() helper method return

A

Returns a ViewResult that renders a view.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

When the ASP.NET MVC 4 Framework comes across a controller action
that returns a non-ActionResult type what does it do

A

automatically wraps the value

in a ContentResult and renders the value as raw content.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

in asp.net where do you enable/disable client side validation and/or unobtrusive javascript

A

web.config,

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

in asp.net mvc 4 how can you include jscripts

A

@section scripts { … }

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

in asp.net mvc 4 what is the idea behind a front controller pattern

A

when an HTTP request is sent, a controller intercepts and processes it.
The controller is responsible for determining how to process the request and for sending
the result back to the client.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

in asp.net mvc 4 what two engines are involved in processing an http request

A

routing and view

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

in asp.net mvc 4 what is the purpose of the action filter

A

security, caching, error handling

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

in asp.net most action methods return an instance of a class called what

A

ActionResult

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

in asp.net mvc 4 action filtering allows for what

A

to perform logic before an action method is called or after an action method runs

17
Q

in asp.net mvc 4 how can you apply action filtering to a class

A

public class SingleSignOnAttribute : ActionFilterAttribute, IActionFilter

18
Q

in asp.net mvc 4 where should business logic exist

A

in the model

19
Q

a yield return accomplishes what

A

it allows for it to save its state whilst also returning a value.

i.e. yield return 1;
yield return 2;

20
Q

in asp.net what does the IEnumerable interface accomplish

A

it allows you to use a collection of objects and enumerate through them like the case of using a foreaach to access each object contained within