Download - Introduction to ASP.NET MVC
![Page 1: Introduction to ASP.NET MVC](https://reader033.vdocuments.us/reader033/viewer/2022061209/548d1ae3b4795909748b45ba/html5/thumbnails/1.jpg)
Who I am
Emad AlashiTTL in eSense Software
www.DotNetArabi.com
www.EmadAshi.com
Twitter: @EmadAshi
![Page 2: Introduction to ASP.NET MVC](https://reader033.vdocuments.us/reader033/viewer/2022061209/548d1ae3b4795909748b45ba/html5/thumbnails/2.jpg)
![Page 3: Introduction to ASP.NET MVC](https://reader033.vdocuments.us/reader033/viewer/2022061209/548d1ae3b4795909748b45ba/html5/thumbnails/3.jpg)
ASP.NET MVCIntroduction to
![Page 4: Introduction to ASP.NET MVC](https://reader033.vdocuments.us/reader033/viewer/2022061209/548d1ae3b4795909748b45ba/html5/thumbnails/4.jpg)
ASP.NET Webforms
• It’s all about Pages• Request pages (*.aspx)• Page lifecycle• Control within the page
• Postback & Viewstate• Tree of controls
![Page 5: Introduction to ASP.NET MVC](https://reader033.vdocuments.us/reader033/viewer/2022061209/548d1ae3b4795909748b45ba/html5/thumbnails/5.jpg)
Webforms Pros
Rich Controls (grids, etc…) RAD Event Driven (Winforms) Statefull
![Page 6: Introduction to ASP.NET MVC](https://reader033.vdocuments.us/reader033/viewer/2022061209/548d1ae3b4795909748b45ba/html5/thumbnails/6.jpg)
Webforms Cons
Less Control No built-in SoC Complicated Page life-cycle Not SEO friendly
URL Big Viewstate at the beginning of the page
![Page 7: Introduction to ASP.NET MVC](https://reader033.vdocuments.us/reader033/viewer/2022061209/548d1ae3b4795909748b45ba/html5/thumbnails/7.jpg)
ASP.NET MVC
![Page 8: Introduction to ASP.NET MVC](https://reader033.vdocuments.us/reader033/viewer/2022061209/548d1ae3b4795909748b45ba/html5/thumbnails/8.jpg)
MVC the pattern
Controller
ModelView
![Page 9: Introduction to ASP.NET MVC](https://reader033.vdocuments.us/reader033/viewer/2022061209/548d1ae3b4795909748b45ba/html5/thumbnails/9.jpg)
ASP.NET MVC
![Page 10: Introduction to ASP.NET MVC](https://reader033.vdocuments.us/reader033/viewer/2022061209/548d1ae3b4795909748b45ba/html5/thumbnails/10.jpg)
ASP.NET MVC
Pipeline:RoutingControllerActionView
High Flexibility
![Page 11: Introduction to ASP.NET MVC](https://reader033.vdocuments.us/reader033/viewer/2022061209/548d1ae3b4795909748b45ba/html5/thumbnails/11.jpg)
Code
![Page 12: Introduction to ASP.NET MVC](https://reader033.vdocuments.us/reader033/viewer/2022061209/548d1ae3b4795909748b45ba/html5/thumbnails/12.jpg)
View Engines
Webforms view engine Bellevue Brail NDjango NHaml NVelocity Razor (favored by Microsoft recently) Spark
![Page 13: Introduction to ASP.NET MVC](https://reader033.vdocuments.us/reader033/viewer/2022061209/548d1ae3b4795909748b45ba/html5/thumbnails/13.jpg)
RazorWebforms
Razor
![Page 14: Introduction to ASP.NET MVC](https://reader033.vdocuments.us/reader033/viewer/2022061209/548d1ae3b4795909748b45ba/html5/thumbnails/14.jpg)
RazorWebforms
Razor
![Page 15: Introduction to ASP.NET MVC](https://reader033.vdocuments.us/reader033/viewer/2022061209/548d1ae3b4795909748b45ba/html5/thumbnails/15.jpg)
Spark
<ul if="products.Any()">
<li each="var p in products">${p.Name}</li>
</ul>
<else>
<p>No products available</p> </else>
![Page 16: Introduction to ASP.NET MVC](https://reader033.vdocuments.us/reader033/viewer/2022061209/548d1ae3b4795909748b45ba/html5/thumbnails/16.jpg)
Filters
IAuthorizationFilter IActionFilter
OnActionExecutingOnActionExecuted
IResultFilterOnResultExecutingOnResultExecuted
IExceptionFilter
![Page 17: Introduction to ASP.NET MVC](https://reader033.vdocuments.us/reader033/viewer/2022061209/548d1ae3b4795909748b45ba/html5/thumbnails/17.jpg)
Built on top of ASP.NET platform
Session Management Memebership Authentication & Authorization Caching Routing Configuration Global.asax Master files etc…
![Page 18: Introduction to ASP.NET MVC](https://reader033.vdocuments.us/reader033/viewer/2022061209/548d1ae3b4795909748b45ba/html5/thumbnails/18.jpg)
ASP.NET MVC Pros
More control SoC SEO friendly TDD Flexible & customizable
![Page 19: Introduction to ASP.NET MVC](https://reader033.vdocuments.us/reader033/viewer/2022061209/548d1ae3b4795909748b45ba/html5/thumbnails/19.jpg)
ASP.NET MVC Cons
Not RAD No rich controls
![Page 20: Introduction to ASP.NET MVC](https://reader033.vdocuments.us/reader033/viewer/2022061209/548d1ae3b4795909748b45ba/html5/thumbnails/20.jpg)
Important
• ASP.NET MVC is web in different taste• Not replacing Webforms• Not better
![Page 21: Introduction to ASP.NET MVC](https://reader033.vdocuments.us/reader033/viewer/2022061209/548d1ae3b4795909748b45ba/html5/thumbnails/21.jpg)
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
![Page 22: Introduction to ASP.NET MVC](https://reader033.vdocuments.us/reader033/viewer/2022061209/548d1ae3b4795909748b45ba/html5/thumbnails/22.jpg)
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
![Page 23: Introduction to ASP.NET MVC](https://reader033.vdocuments.us/reader033/viewer/2022061209/548d1ae3b4795909748b45ba/html5/thumbnails/23.jpg)
Q & A
Emad Alashiwww.emadashi.comwww.dotnetarabi.com@EmadAshi