ASP.NET MVCfor BeginnersShravan KumarThomson Reuters
Walk Away KnowingIntroduction to ASP.NET MVCProblems with ASP.NET
What is ASP.NET?One web applicationframework to rule them all…ASP.NETCachingModulesGlobalizationPagesControlsMaster PagesProfileRolesMembershipIntrinsicsHandlersEtc...
ASP.NET WebFormsPresentationASP.NET CORERuntime
Are you happy with ASP.NET?
WebForms is great, But it does have some weaknesses
No real role responsibility…Master PageControlControlUIPresentation LogicBusiness LogicData AccessControlControlPageControlControlControlControlWho does what?How and when?
Control abstractions can be negative…
It isn’t easy enoughto testUILogic
How does ASP.NET MVC Differ?A new Web Application Project typeNot a replacement for WebForms -Builds on top of ASP.NETSimply an another option
Now ASP.NETASP.NET WebFormsASP.NETMVCPresentationASP.NET CORERuntime
What is MVC?A design patternSeparation of concernsAcronym for Model ● View ● Controller
Separation of ConcernsSRP – Single Responsibility Principle
DRY – Don’t Repeat YourselfMore easily testable (TDD)Helps with concurrent development
MVC
Framework GoalsFrictionless TestabilityTight control over <markup/>User/SEO friendly URLsLeverage the benefits of ASP.NETConventions and Guidance
Clean URLsREST-like/products/update/blog/posts/2008/08/12/mvc-is-coolFriendlier to humans/product.aspx?categoryid=123 to becomeBecomes /products/kittens/Friendlier to web crawlersSearch engine optimization (SEO)
ExtensibleReplace any component of the systemInterface-based architecture
Very few sealed methods / classesPlays well with others
What is MVC? ControllerRequestStep 1Incoming request routed to Controller
What is MVC?ControllerModelStep 2Controller processes request and creates presentation Model
What is MVC? ControllerViewStep 3Model is passed to View
What is MVC? ControllerViewStep 4View transforms Model into appropriate output format
What is MVC? ControllerViewResponseStep 5Response is rendered
DEMO – ASP.NET MVC

ASP.NET MVC for Begineers