05 Handout 1 Flashcards
is based on a web page approach in designing web applications, while ASP .NET MVC emphasizes the separation of concerns
ASP .NET Web Forms
It emphasizes the separation of concerns
ASP .NET MVC
ASP .NET is divided into three (3) parts:
- Model
- View
- Controller
is the data that is being displayed
model
is how the data is being displayed to the user
view
is the intermediary that does the work of ensuring that the appropriate model is presented to the correct view
controller
Key different between ASP .NET Web Forms and MVC is that
it presents views, not pages to the client
Web Forms takes a file system approach to presenting content
true
MVC takes an approach whereby content is based on the “type of action”
true
The … pattern specifies where each type of logic should be located within your application
MVC
The …. belongs in the view
UI-specific logic
Input logic, or the logic that handles the request from the client, belongs in the …
controller
Business logic belongs in the … layer
model
example of model
public class Demo{
public string Property1 {get; set;}
public string Property2 {get; set;}
public string Property3 {get; set;}
}
example of view
@Html.DisplayFor(model => model.Property1)
example of controller
public ActionResult Details(int id){
Demo dm = new Demo{
Property1 = id.ToString(),
Property2 = string.Format(“Property2 {0}”, id),
Property3 = string.Format(Property3 {0}”, id)
};
return View(“DemoView”, dm);d
}
ASP .NET Web Forms makes a very firm linkage between the markup file and the applicable processing file
true
ASP .NET MVC is different, there is no automatic one-to-one relationship between the files
true
A project template that is used to create an ASP .NET Web Forms application
Web Form Template
The MVC project template is used to create an ASP .NET MVC project
MVC Template
Used for creating the HTML output that makes up the view portion of the MVC application
View File (.vbhtml, .cshtml)
Used by the browser to manage execution of code on the client side
JavaScript file (.js)
Anything that is compiled, executes, and runs; both models and controllers are stored as code files within the project
Code file (.vb, .cs)
Gives the browser instruction on how to style the appearance of the web page
Style sheet file (.css)
Contains configuration information that is used by the application, such as a database configuration string, shown later
Configuration (.config)
Used by Microsoft IIS web server to handle application and session-level events such as creating routes
Application event file (.asax)
A static web file that does not do any server-side processing yet presents HTML to the browser for rendering
Web file (.html)
A folder used for data storage. It generally holds any SQL server .mdf file that may be used in the web application
App_Data
It contains many of the configuration files used by an application
App_Start
It is designed to hold items that will be sent to the client. The Cascading Style Sheets (CSS) were created as part of the initial application templates stored in this folder.
Content
This directory holds some of the glyph-fonts used in the default application
Fonts
This folder is used to hold the models that were created as part of the template process
Models
This folder is used to store the JavaScript files that are sent to the client’s browser to perform client-side processing
Scripts
Determining the appropriate development approach
- Background and experience of the developers