Introduction to ASP.NET MVC [Name] [ Address] [Blog URL]
Session Objectives What is ASP.NET MVC? What is MVC? Is it deprecating WebForms? What are its value propositions? Is ASP.NET MVC right for you? Can it ease some web development pain you’re currently having? Takeaways
ASP.NET Then… CachingCachingModulesModules HandlersHandlers IntrinsicsIntrinsics PagesPagesControlsControls GlobalizationGlobalization ProfileProfile Master Pages MembershipMembership RolesRoles Etc.Etc. ASP.NET One web application framework to rule them all…
ASP.NET Now… ASP.NET Dynamic Data ASP.NET Dynamic Data ASP.NET WebForms ASP.NET WebForms ASP.NET MVC ASP.NET MVC Presentation Runtime ASP.NET Core ASP.NET Core
WebForms is great, but options are good…
Master Page Control No real role responsibility… UI Presentation Logic Business Logic Data Access Who does what? How and when? Control Page Control
Control abstractions can be negative…
It isn't easy enough to test… Logic UI
So how does ASP.NET MVC differ?
MVC = Model-View-Controller Controller(Input)Controller(Input) Model(Logic)Model(Logic)View(Presentation)View(Presentation) Separation of concerns!
How does MVC look? Request View Controller Response Controller Handles input (HTTP requests) View Visually represents the model
File | New
What are the tenets of ASP.NET MVC?
Framework Goals Frictionless Testability Tight control over Leverage the benefits of ASP.NET Conventions and guidance …
Clean URLs Don’t settle for… /Products.aspx?CategoryID=123 When you can easily have… /Product/Puppies Or whatever else makes sense…
Extensibility Controller Builder Controller Builder Controller Factory Controller Factory Controller View Engine View Engine View Controller Action Invoker Controller Action Invoker Action Result Action Result Action Filters Action Filters Model Binders Model Binders Any of this can be replaced!
MVC Development
How about unit testing?
Unit Testing
Summary ASP.NET MVC is a new application option built on top of ASP.NET WebForms isn’t being deprecated ASP.NET MVC strives to provide strong, frictionless testability It places a lot of the control in your hands