Introduction to ASP.NET MVC

2,322 views
2,222 views

Published on

presents what ASP.NET MVC is and how it is compared to ASP.NET Webforms.

Published in: Technology
2 Comments
1 Like
Statistics
Notes
  • Ahlan Saed, Actually yes, the investment Microsoft put in ASP.NET webforms is enormous; the environment built around it and the community is just not that easy to discard.

    Another reason is that ASP.NET MVC is a little bit more sophisticated framework to work against than the webforms, hence it will not be easy for companies comfortable in webforms envirronment to switch to ASP.NET MVC.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • hi emad,did really mean it in slide 20 ??
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
2,322
On SlideShare
0
From Embeds
0
Number of Embeds
570
Actions
Shares
0
Downloads
65
Comments
2
Likes
1
Embeds 0
No embeds

No notes for slide

Introduction to ASP.NET MVC

  1. 1. Who I am Emad Alashi TTL in eSense Software www.DotNetArabi.com www.EmadAshi.com Twitter: @EmadAshi
  2. 2. Introduction to
  3. 3. ASP.NET Webforms • It’s all about Pages • Request pages (*.aspx) • Page lifecycle • Control within the page • Postback & Viewstate • Tree of controls
  4. 4. Webforms Pros  Rich Controls (grids, etc…)  RAD  Event Driven (Winforms)  Statefull
  5. 5. Webforms Cons  Less Control  No built-in SoC  Complicated Page life-cycle  Not SEO friendly  URL  Big Viewstate at the beginning of the page
  6. 6. ASP.NET MVC
  7. 7. MVC the pattern Controller ModelView
  8. 8. ASP.NET MVC
  9. 9. ASP.NET MVC Pipeline:  Routing  Controller  Action  View  High Flexibility
  10. 10. Code
  11. 11. View Engines  Webforms view engine  Bellevue  Brail  NDjango  NHaml  NVelocity  Razor (favored by Microsoft recently)  Spark
  12. 12. Razor Webforms Razor
  13. 13. Razor Webforms Razor
  14. 14. Spark <ul if="products.Any()"> <li each="var p in products">${p.Name}</li> </ul> <else> <p>No products available</p> </else>
  15. 15. Filters  IAuthorizationFilter  IActionFilter  OnActionExecuting  OnActionExecuted  IResultFilter  OnResultExecuting  OnResultExecuted  IExceptionFilter
  16. 16. Built on top of ASP.NET platform  Session Management  Memebership  Authentication & Authorization  Caching  Routing  Configuration  Global.asax  Master files  etc…
  17. 17. ASP.NET MVC Pros  More control  SoC  SEO friendly  TDD  Flexible & customizable
  18. 18. ASP.NET MVC Cons  Not RAD  No rich controls
  19. 19. Important • ASP.NET MVC is web in different taste • Not replacing Webforms • Not better
  20. 20. RESTful (by Roy Fielding)  It’s all about nouns (Resources)  A representation of a resource is typically a document that captures the current or intended state of a resource.  URI  Stateless  Utilizes web architecture (Methods: GET, POST, PUT, and DELETE)  Simple  Less bandwidth  Generality  Human readable
  21. 21. References  www.asp.net/mvc  Comparing Web Forms And ASP.NET MVC (Dino Esposito)  Scott Guthrie: http://weblogs.asp.net/scottgu  Scott Hanselman: www.computerzen.com  Wikipedia: MVC, RESTful  “Pro ASP.NET MVC 2 Framework” book by Steven Sanderson  ASP.net MVC Vs ASP.net Web Form  REST vs. SOAP – The Right WebService  REST (Representational State Transfer) and RESTful web services: Methods, Concepts and Examples
  22. 22. Q & A Emad Alashi www.emadashi.com www.dotnetarabi.com @EmadAshi

×