4. The Downside of ASP.NET
• Very complex page pipeline engine
• Difficult to maintain
• Impossible to test
– Difficulty partially arises from simulating
Context, Request, Response, and Session objects.
• The cryptic control ids and sensitivities of ViewState
• Overly mix business and presentation logic
• Event-driven model
6. MVC Framework
History
1970S
2003 RoR
Based on Python
…. 2009.3 MVC1
2010.4 MVC2
7. ASP.NET MVC IS……
• New ASP.NET application development style
– Another is“ASP.NET Web Form”
– Fill the gaps of ASP.NET Web Form
• New choice
• Full control over URLs
• Full control over HTML
• Easier to test (TDD)
• Flexible, extendable, easily replaced
8. ASP.NET MVC IS NOT……
• The substitute of 3-tier structure
• ASP.NET Web Form’s substitute
• ASP.NET Web Form promotion version
– ASP.NET Web Form 4.0
• Fit RAD
• Fit every project
• Fit everyone
9. Different Between with Web Form
Classic Web Form ASP.NET MVC
Postback REST, HTML Post
Code behind Separate controller
Single form Multiple forms
Server controls HTML Helpers
Page and control lifecycle Controller
11. ASP.NET MVC Framework Structure
ASP.NET Abstractions
(System.Web.Abstractions.dll)
ASP.NET Routing
(System.Web.Routing.dll)
ASP.NET MVC
(System.Web.Mvc.dll)
13. Classic Application Architecture
MvcDemo.Web.UI
Presentatio
MvcDemo.Models
n MvcDemo.Web.Controllers
Biz MvcDemo.Business
Service
DataAccess MvcDemo.Data
Responsity
16. ASP.NET Routing
• URL Patterns
• Setting Default Values for URL Parameters
• Adding Constraints to Routes
• Scenarios When Routing Is Not Applied
• How URLs Are Matched to Routes
• Accessing URL Parameters in a Routed Page
• ASP.NET Routing and Security
• ASP.NET Routing versus URL Rewriting
24. Best Practices
Securing MVC applications
Dependency Injection of Controllers
Using RESTful Architecture
Handling errors in MVC applications
Unit Test & MVC Mock Helpers
Using AJAX in ASP.NET MVC applications
Improving ASP.NET MVC application performance
Localizing ASP.NET MVC Validation
Deploying MVC applications
26. • New Strongly Typed HTML Helpers
• Enhanced Model Validation support across both server and
client
• Auto-Scaffold UI Helpers with Template Customization
• Support for splitting up large applications into “Areas”
• Asynchronous Controllers support that enables long
running tasks in parallel
• Support for rendering sub-sections of a page/site using
Html.RenderAction
• Lots of new helper functions, utilities, and API
enhancements
• Improved Visual Studio tooling support
27. Areas
• Introduction
– Organizing our projects hierarchically into folders
and namespaces
• Building a portable area
• Embedding Views
• Distributing a portable area
28. Async Controllers Support
• Change the way of request handling
• Decide whether the action is async or not
• Execute an action
• ModelBinder support
• Limitations and drawbacks
29. http://nerddinner.codeplex.com/
[Video]Creating NerdDinner.com with MVC
Oxite 2: An official CMS Product
MvcContrib: a Codeplex Foundation Project
http://mvccontrib.codeplex.com/
http://tailspintravel.codeplex.com
http://mvcsitemap.codeplex.com/
http://mvcmembership.codeplex.com/
http://code.msdn.microsoft.com/aspnetmvcsamples
Nice projects to learn MVC
RECOURSE
30. Please fill out the session evaluation form
provided and drop it off with the staff at the exit.
Your Feedback is Important!
IT IS OVER,THANKS