Head First ASP.Net MVC 2.0<br />Zhiming Jiang<br />MSN GMD Integration<br />
TOPIC<br />Review<br />Getting started with ASP.NET MVC<br />Understanding ASP.NET MVC<br />Customizing and Extending<br /...
review<br />The way of ASP.NET MVC<br />
The Downside of ASP.NET<br />Very complex page pipeline engine<br />Difficult to maintain <br />Impossible to test<br />Di...
Innovation!<br />
MVC FrameworkHistory<br />Based on Python<br />1970S<br />….<br />2003 RoR<br />{ ASP.NET MVC }<br />2009.3 MVC1 <br />201...
ASP.NET MVCIS……<br />New ASP.NET application development style<br />Another is“ASP.NET Web Form”<br />Fill the gaps of ASP...
ASP.NETMVCIS NOT……<br />The substitute of 3-tier structure<br />ASP.NET WebForm’ssubstitute <br />ASP.NET Web Formpromotio...
Different Between with Web Form<br />
Getting started with ASP.NET MVC<br />ASP.NET MVC101<br />
ASP.NET MVCFramework Structure<br />ASP.NET Abstractions<br />(System.Web.Abstractions.dll)<br />ASP.NET Routing<br />(Sys...
But what is the work process?<br />但是具体的流程是什么样?<br />
Classic Application Architecture<br />MvcDemo.Web.UI<br />MvcDemo.Models<br />Presentation<br />MvcDemo.Web.Controllers<br...
ASP.NETMVCExcute Process<br />
Understanding ASP.NET MVC<br />Understanding Models, Views, and Controllers<br />
ASP.NET Routing<br />URL Patterns<br />Setting Default Values for URL Parameters<br />Adding Constraints to Routes<br />Sc...
Working with Models<br />What’s Model<br />Validation<br />
Controllers & Action<br />Receiving input<br />QueryString, Request.Form, FormCollection, Custome(IModelBinding)<br />Filt...
Filtering Action Methods<br />
Working with Views<br />View Engine<br />View Page<br />View Data<br />View Helper<br />Form Post<br />Using MasterPage<br...
Customizing and Extending<br />MVC Custom and Extensions<br />
Customizing & Extending<br />Extending URL Routing<br />Customer ControllerFactory<br />Extending Controller & Action<br /...
Best Practices<br />Truth in Practice<br />
Best Practices<br /><ul><li>Securing MVC applications
Dependency Injection of Controllers
Using RESTfulArchitecture
Handling errors in MVC applications
Unit Test & MVC Mock Helpers
Using AJAX in ASP.NET MVC applications
Improving ASP.NET MVC application performance
Upcoming SlideShare
Loading in …5
×

Head first asp.net mvc 2.0 rtt

6,579 views
6,374 views

Published on

Head first asp.net mvc 2.0

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
6,579
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
96
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Head first asp.net mvc 2.0 rtt

  1. 1. Head First ASP.Net MVC 2.0<br />Zhiming Jiang<br />MSN GMD Integration<br />
  2. 2. TOPIC<br />Review<br />Getting started with ASP.NET MVC<br />Understanding ASP.NET MVC<br />Customizing and Extending<br />Best Practices<br />MVC 2.0 New Features<br />
  3. 3. review<br />The way of ASP.NET MVC<br />
  4. 4. The Downside of ASP.NET<br />Very complex page pipeline engine<br />Difficult to maintain <br />Impossible to test<br />Difficulty partially arises from simulating Context, Request, Response, and Session objects.<br />The cryptic control ids and sensitivities of ViewState<br />Overly mix business and presentation logic<br />Event-driven model<br />
  5. 5. Innovation!<br />
  6. 6. MVC FrameworkHistory<br />Based on Python<br />1970S<br />….<br />2003 RoR<br />{ ASP.NET MVC }<br />2009.3 MVC1 <br />2010.4 MVC2<br />
  7. 7. ASP.NET MVCIS……<br />New ASP.NET application development style<br />Another is“ASP.NET Web Form”<br />Fill the gaps of ASP.NET WebForm<br />New choice<br />Full control over URLs<br />Full control over HTML<br />Easier to test (TDD) <br />Flexible, extendable, easily replaced<br />
  8. 8. ASP.NETMVCIS NOT……<br />The substitute of 3-tier structure<br />ASP.NET WebForm’ssubstitute <br />ASP.NET Web Formpromotion version<br />ASP.NET Web Form 4.0<br />Fit RAD<br />Fit every project<br />Fit everyone<br />
  9. 9. Different Between with Web Form<br />
  10. 10. Getting started with ASP.NET MVC<br />ASP.NET MVC101<br />
  11. 11. ASP.NET MVCFramework Structure<br />ASP.NET Abstractions<br />(System.Web.Abstractions.dll)<br />ASP.NET Routing<br />(System.Web.Routing.dll)<br />ASP.NET MVC<br />(System.Web.Mvc.dll)<br />
  12. 12. But what is the work process?<br />但是具体的流程是什么样?<br />
  13. 13. Classic Application Architecture<br />MvcDemo.Web.UI<br />MvcDemo.Models<br />Presentation<br />MvcDemo.Web.Controllers<br />BizService<br />MvcDemo.Business<br />DataAccessResponsity<br />MvcDemo.Data<br />
  14. 14. ASP.NETMVCExcute Process<br />
  15. 15. Understanding ASP.NET MVC<br />Understanding Models, Views, and Controllers<br />
  16. 16. ASP.NET Routing<br />URL Patterns<br />Setting Default Values for URL Parameters<br />Adding Constraints to Routes<br />Scenarios When Routing Is Not Applied<br />How URLs Are Matched to Routes<br />Accessing URL Parameters in a Routed Page<br />ASP.NET Routing and Security<br />ASP.NET Routing versus URL Rewriting<br />
  17. 17. Working with Models<br />What’s Model<br />Validation<br />
  18. 18. Controllers & Action<br />Receiving input<br />QueryString, Request.Form, FormCollection, Custome(IModelBinding)<br />Filter<br />Aysncaction<br />Producing output<br />Action Result, View Data, View Model<br />How defines<br />End with the word Controller<br />Inherit from System.Web.Mvc.Controller (or implement Icontroller<br />Contain public methods that return ActionResult<br />
  19. 19. Filtering Action Methods<br />
  20. 20. Working with Views<br />View Engine<br />View Page<br />View Data<br />View Helper<br />Form Post<br />Using MasterPage<br />Order<br />
  21. 21. Customizing and Extending<br />MVC Custom and Extensions<br />
  22. 22. Customizing & Extending<br />Extending URL Routing<br />Customer ControllerFactory<br />Extending Controller & Action<br />Custom View Engine<br />T4 Template<br />
  23. 23. Best Practices<br />Truth in Practice<br />
  24. 24. Best Practices<br /><ul><li>Securing MVC applications
  25. 25. Dependency Injection of Controllers
  26. 26. Using RESTfulArchitecture
  27. 27. Handling errors in MVC applications
  28. 28. Unit Test & MVC Mock Helpers
  29. 29. Using AJAX in ASP.NET MVC applications
  30. 30. Improving ASP.NET MVC application performance
  31. 31. Localizing ASP.NET MVC Validation
  32. 32. Deploying MVC applications</li></li></ul><li>MVC 2.0 New Features<br />Areas, Async Controllers Support, Scaffold …<br />
  33. 33. <ul><li>New Strongly Typed HTML Helpers
  34. 34. Enhanced Model Validation support across both server and client
  35. 35. Auto-Scaffold UI Helpers with Template Customization
  36. 36. Support for splitting up large applications into “Areas”
  37. 37. Asynchronous Controllers support that enables long running tasks in parallel
  38. 38. Support for rendering sub-sections of a page/site using Html.RenderAction
  39. 39. Lots of new helper functions, utilities, and API enhancements
  40. 40. Improved Visual Studio tooling support</li></li></ul><li>Areas<br />Introduction<br />Organizing our projects hierarchically into folders and namespaces<br />Building a portable area<br />Embedding Views<br />Distributing a portable area<br />
  41. 41. Async Controllers Support<br />Change the way of request handling<br />Decide whether the action is async or not<br />Execute an action<br />ModelBinder support<br />Limitations and drawbacks<br />
  42. 42. Recourse<br />Nice projects to learn MVC<br />http://nerddinner.codeplex.com/<br />[Video]Creating NerdDinner.com with MVC<br />Oxite 2: An official CMS ProductMvcContrib: a Codeplex Foundation Project<br />http://mvccontrib.codeplex.com/<br />http://tailspintravel.codeplex.com<br />http://mvcsitemap.codeplex.com/<br />http://mvcmembership.codeplex.com/http://code.msdn.microsoft.com/aspnetmvcsamples<br />
  43. 43. IT is over,Thanks<br />Your Feedback is Important!<br />Please fill out the session evaluation form provided and drop it off with the staff at the exit.<br />

×