ASP.NET MVC Overview

advertisement
E4D SOLUTIONS LTD
EXPERTS DESIGN DEVELOP DEBUG DEPLOY
ASP.NET MVC 3.0
‫ שעות‬16 ‫זמן‬
The Model-View-Controller (MVC) pattern is an architectural design principle
that separates the components of a Web application. This separation gives
you more control over the individual parts of the application, which lets you
more easily develop, modify, and test them.
ASP.NET MVC is part of the ASP.NET framework. Developing an ASP.NET
MVC application is an alternative to developing ASP.NET Web Forms pages;
it does not replace the Web Forms model.
Day I
Module 1: ASP.NET MVC Overview
ASP.NET MVC is part of the ASP.NET framework. Developing an ASP.NET MVC application
is an alternative to developing ASP.NET Web Forms pages; it does not replace the Web
Forms model
.
The Model-View-Controller (MVC) Pattern
Razor Engine
Hello World in ASP.NET MVC
Understanding MVC Application Execution
Models and ViewData
HTML Helpers
Startup Code
Configuration
Module 2: Controllers & Action Methods
The ASP.NET MVC framework maps URLs to classes that are referred to as controllers.
Controllers process incoming requests, handle user input and interactions, and execute
appropriate application logic. A controller class typically calls a separate view component to
generate the HTML markup for the request
.
Controllers Overview
Action Methods
Action Result Return Type
Action Method Parameters
Action Filters
Custom Action Filters
1
E4D SOLUTIONS LTD
EXPERTS DESIGN DEVELOP DEBUG DEPLOY
Caching Child Actions
The View Bag
Request Validation
Using an Asynchronous Controller
Lab: ASP.NET MVC 3 Fundamentals
This Hands-On Lab is based on MVC (Model View Controller) Music Store, a tutorial
application that introduces and explains step-by-step how to use ASP.NET MVC and Visual
Web Developer 2010 Express (which is free). Throughout the lab you will learn the simplicity,
yet power of using these technologies together. You will start with a simple application and
will build it until you have a fully functional MVC Web Application.
Module 3: Views and UI Rendering
The ASP.NET MVC framework includes helper methods that provide an easy way to render
HTML in a view
.
Rendering UI with Views
View Pages
Master-Page Views
Partial Views
Helper Classes and Members for Rendering Views
View Injection
Lab: ASP.NET MVC 3 Razor
ASP.NET MVC 3 introduces the new view engine Razor, which was conceived to simplify the
current syntax used in ASP.NET web pages. In this lab you will learn how to create Razor
views inside an MVC solution. In the beginning of this Lab you will first get familiar with Razor
syntax and its features: general rules, code blocks, inline HTML and layout pages. Once you
have learned the basics, in Exercise 2 you will add Razor views in the MVC Music Store
solution to provide the same functionality you have in ASP.NET views, but with a clearer and
reduced code. At the end of this lab, in Exercise 3, you will learn how to create and consume
third party Razor Helpers
Module 4: Models
In the ASP.NET MVC framework, the model is the part of the application that is responsible
for the core application or business logic. Model objects typically access data from a
persistent store, such as SQL Server, and perform the business logic on that data. Models
are application specific, and therefore the ASP.NET MVC framework puts no restrictions on
the kinds of model objects you can build
.
Defining the Model
Integrating the Model and Controller
Model Binders
2
E4D SOLUTIONS LTD
EXPERTS DESIGN DEVELOP DEBUG DEPLOY
Lab: ASP.NET MVC 3 Models and Data Access
This Hands-on Lab will show you how to use the free SQL Server Express as a database
engine in order to store and retrieve the data needed for the Music Store application. To
accomplish that, you will start with an already created database, from which you will generate
the Entity Data Model you will use in the application.
Day II
Module 5: Validation
ASP.NET MVC shipped both client- and server-side validation support
.
Validation in MVC
Data Annotations
Custom Validation Attributes
Client Validation
Custom Client Validation
Remote Validation
Lab: Custom Validation
In ASP.NET MVC Helpers, Forms and Validation Hands-on Lab , you have been validating
data from the create and edit album forms. In this Hands-on Lab, you will use custom
validation logic to control price range in the server side as well as in the client. In order to
achieve that, in the first exercise you will create a custom validation property attribute and
then add it to the Album model. The existing create and edit views in the StoreManager
controller will process the new custom validation from the server side. In the second exercise,
you will add JavaScript code and associate it to the previous custom validation, making the
same views run that validation code at client side.
Module 6: ASP.NET MVC & JavaScript Frameworks
ASP.NET MVC and Microsoft AJAX
ASP.NET MVC and JQuery
Module 7: Security
Membership
Role Management
MVC Authorize Attribute
Attacks
3
E4D SOLUTIONS LTD
EXPERTS DESIGN DEVELOP DEBUG DEPLOY
Module 8: Internals & Extensibility
Routing
Dependency Resolver
Controller Extensibility
Model Extensibility
View Extensibility
Lab: Dependency Injection
In Object Oriented Programming paradigm, objects work together in a collaboration model
where there are contributors and consumers. Naturally, this communication model generates
dependencies between objects and components that could became difficult to manage when
complexity increases . You have probably heard about Factory Pattern and the separation
between the interface and the implementation using services. However, the client objects are
often responsible for service location. Before introducing the Dependency Injection Pattern,
we will explain what Inversion of Control (IoC) principle is. With Inversion of Control (Ioc),
consumer objects do not create the other objects on which they rely. Those objects come
from an external source.
4
Download