ASP.Net MVC 101

undefined
undefined
Core
Filter Interface
What to test
ASP.Net MVC 101
URL Routing
Rule
Extented Routing
MVC Role
Model
Model
Validation
Model Binding
Validation
Controller
Action
Controller & Action
Receiving Input
QueryString
Request.Form
FormCollection
Custome(IModelBinding)
Async Action
Filter
HttpModule
Level
Controller
Action
IActionFilter
OnActionExcuting
OnActionExcuted
IResultFilter
OnResultExecuting
OnResultExecuted
IAuthorizationFilters
OnAuthorization
IExceptionFilter
OnException
Order
ActionFilterAttribute
OutputCacheAttribute
AuthorizeAttribute
ValidateInputAttribute
ValidateAntiforgeryTokenAttribute
HandleErrorAttribute
Class hierarchy of ASP.NET MVC’s built-in filter
FilterAttribute
{Attribute}
Producing Output
Action Result
Return this type
ViewResult
ViewResultBase
ContentResult
RedirectResult
JsonResult
JavaScriptResult
EmptyResult
FileResult
FileContentResult
FilePathResult
FileStreamResult
TempData
View Data
PartialView
View Model
How defines
End with the word Controller
Inherit from System.Web.Mvc.Controller (or implement IController
Contain public methods that return ActionResult
View
ViewEngine
ViewPage
StrongType
View Data
ViewModel
HTML Helper
RenderPartial
Using MasterPage
Partial views
Form Posting
Validation and Error Reporting
Customizing & Extending
Extending URL Routing
Custom ControllerFactory
Leveraging IoC for Controllers
Extending the Controller & Action
Custom View Engine
Custom T4 Templates
Introduction
What's ASP.Net MVC
A MVC in ASP.Net
MVC Pattern
Model
View
Controller
Why ASP.Net MVC
Full control over HTML
Full control over URLs
Better separation of concerns
Extensibility
Testability
Differents
1
REST/POST
MVC
Postback
Web Form
2
Controller
MVC
Page and control lifecycle
Web Form
3
Separate controller
MVC
Code behind
Web Form
MVC Life Cycle
Routing
Namespace
MvcHandler
ControllerActionInvoker
ViewResult
ControllerContext
2.0 Features
Areas
Dynamic Scaffolding
Enhanced Model Validation
Asynchronous Controllers support
rendering sub-sections
Important
Namespaces & Class
HttpApplication
Application_Start
Application_BeginRequest
HttpContextBase
HttpContextWrapper
HttpContext
Q/A
Convention Over Configuration
MVC and 3 tier architecture
Leveraging Existing ASP.NET Features
Practices
Unit test
Principle
routes
controllers
custom model binders
action filters
Mocks
Moq
Lambda available
Lambda available
Rhino.Mocks
Full-featured &
Powerful
Full System Testing
AJAX
jQuery
Microsoft Ajax
Scaling the Architecture
for More Complex Sites
Data Access
Project & Extentions
Codeplex.com
MVC Contrib
MVC Framework Extentio...
MVC Membership
Oxite 2
NerdDinner
Subtopic 4
Customizing VS for MVC
T4 Templete
Security
Authentication
authorization
AuthorizeAttribute
XSS
Dependency Injection of Controllers
Unity
Zhiming Jiang
MSN GMD Integration
@lanvige
lanvige@gmail.com
24 1