Programming Microsoft ASP.NET MVC Flashcards

1
Q

ASP

A

Active Server Page

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

Razor Syntax Rules for C#

A
  • Razor code blocks are enclosed in @{ … }
  • Inline expressions (variables and functions) start with @
  • Code statements end with semicolon
  • Variables are declared with the var keyword
  • Strings are enclosed with quotation marks
  • C# code is case sensitive
  • C# files have the extension .cshtml
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Main Razor Syntax Rules for VB

A
  • Razor code blocks are enclosed in @Code … End Code
  • Inline expressions (variables and functions) start with @
  • Variables are declared with the Dim keyword
  • Strings are enclosed with quotation marks
  • VB code is not case sensitive
  • VB files have the extension .vbhtml
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

The root on a disk drive C:\ (backwark slash)

A

The root on a web site is / (forward slash).

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

~ Operator

A

Virtual root in programming code

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

Server.MapPath Method

A

The Server.MapPath method converts a virtual path (/default.cshtml) to a physical path that the server can understand

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
  • href
  • RenderBody()
  • RenderPage(page)
  • RenderSection(section)
  • Write(object)
  • WriteLiteral
A
  • Builds a URL using the specified parameters
  • Renders the portion of a content page that is not within a named section (In layout pages)
  • Renders the content of one page within another page
  • Renders the content of a named section (In layout pages)
  • Writes the object as an HTML-encoded string
  • Writes an object without HTML-encoding it first.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
  • IsPost
  • Layout
  • Page
  • Request
  • Server
A
  • Returns true if the HTTP data transfer method used by the client is a POST request
  • Gets or sets the path of a layout page
  • Provides property-like access to data shared between pages and layout pages
  • Gets the HttpRequest object for the current HTTP request
  • Gets the HttpServerUtility object that provides web-page processing methods
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
A

non-breaking space

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

MVC

A
  • Models: Classes that represent the data of the application and that use validation logic to enforce business rules for that data
  • Views: Template files that your application uses to dynamically generate HTML responses
  • Controllers: Classes that handle incoming browser requests, retrieve model data, and then specify view templates that return a response to the browser
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

IDE

A

Integrated development environment

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

Default MVC URL

A

/[Controller]/[ActionName]/[Parameters]

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

C# optional-parameter

A
  • function ( x = 1 )
  • = 1 is optional
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q
  • &
  • ?
A
  • The & character separates query strings
  • The ? character separates the URL and query strings
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

EF

A
  • Entity Framework
  • Use for accessing data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Visual Studio automatically created the CRUD action methods and views

A

(create, read, update, and delete)

17
Q

@Html.ActionLink(“Edit”, “Edit”, new { id=item.ID })

A
  • The first argument to the ActionLink method is the link text to render
  • The second argument is the name of the action method to invoke
  • The final argument is an anonymous object that generates the route data
18
Q

HttpPost attribute
[HttpPost]

A

This attribute specifies that that overload of the Edit method can be invoked only for POST requests

19
Q

Bind attribute
public ActionResult Edit([Bind()] )

A

The Bind attribute is an important security mechanism that keeps hackers from over-posting data to your model

20
Q

ModelState.IsValid method

A

Verifies that the data submitted in the form can be used to modify (edit or update) an object

21
Q

Html.ValidationMessageFor

A

The Html.ValidationMessageFor helpers in the Edit.cshtml view template take care of displaying appropriate error messages.

22
Q

LINQ

A

Language-Integrated Query

23
Q

The s => s.Title code

A

Lambda Expression used in method-based LINQ queries as arguments to standard query operator methods