You are on page 1of 24

For ASP.

NET Core Online Training : +91-999 123 502

Introduction to ASP.NET MVC


Shailendra Chauhan
Microsoft MVP, Technical Consultant and Corporate Trainer
For ASP.NET Core Online Training : +91-999 123 502

Agenda
• Introduction to ASP.NET MVC
• ASP.NET MVC Evolution History
• ASP.NET Webforms vs ASP.NET MVC
• Advantages of ASP.NET MVC
• MVC Pattern
• MVC vs. 3-Tiers
• Routing
• ASP.NET MVC Pipeline
For ASP.NET Core Online Training : +91-999 123 502

ASP.NET MVC
• A new web development style on the
top of ASP.NET framework. WebForms
WebForms MVC
• Based on MVC pattern and an
alternative to WebForms. ASP.NET Framework
• Doesn’t support pages and code
behind, server-controls, drag and drop, .NET Framework
postback, view state and event life
cycle.
For ASP.NET Core Online Training : +91-999 123 502

ASP.NET MVC Evolution History

ASP.NET ASP.NET ASP.NET


ASP.NET ASP.NET ASP.NET ASP.NET
MVC 4, MVC 5, MVC 5.2.3,
MVC 1 4.0, MVC 2 4.5, MVC 3 MVC 5.2.6
WebAPI WebAPI 2 WebAPI 2.2
2009 2010 2011 2018
2012 2013 2015
For ASP.NET Core Online Training : +91-999 123 502

ASP.NET MVC1
• Released on Mar 13, 2009
• Runs on .NET 3.5 and with Visual Studio 2008
• MVC Pattern architecture with WebForm Engine
• Html Helpers
• Ajax helpers
• Routing
• Unit Testing
For ASP.NET Core Online Training : +91-999 123 502

ASP.NET MVC2
• Released on Mar 10, 2010
• Runs on .NET 3.5, 4.0 and with Visual Studio 2008 & 2010
• Strongly typed HTML helpers with lambda expression
• Support for Data Annotations Attribute
• Client-side validation
• UI helpers
• Areas for partitioning a large applications into modules
• Asynchronous controllers
For ASP.NET Core Online Training : +91-999 123 502

ASP.NET MVC3
• Released on Jan 13, 2011
• Runs on .NET 4.0 and with Visual Studio 2010
• Razor view engine
• Unobtrusive JavaScript validation
• Remote validation
• Compare Attribute
• ViewBag
• Sessionless Controller
For ASP.NET Core Online Training : +91-999 123 502

ASP.NET MVC3 Contd.


• Global filters
• Child Action Output Caching
• Dependency resolver for IoC
• Use of NuGet to deliver software and manage dependencies
throughout the platform
For ASP.NET Core Online Training : +91-999 123 502

ASP.NET MVC4
• Released on Aug 15, 2012
• Runs on .NET 4.0,4.5 and with Visual Studio 2010SP1 & 2012
• ASP.NET Web API
• Mobile project template using jQuery Mobile
• Display Modes
• Task support for Asynchronous Controllers
• Bundling and minification
• Support for the Windows Azure SDK
For ASP.NET Core Online Training : +91-999 123 502

ASP.NET MVC5
• Released on 17 October 2013
• Runs on .NET 4.5 and with Visual Studio 2013
• One ASP.NET
• ASP.NET Identity
• ASP.NET Scaffolding
• Authentication filters
• Bootstrap in the MVC template
• ASP.NET Web API2
• Attribute Routing
For ASP.NET Core Online Training : +91-999 123 502

ASP.NET WebForms vs. ASP.NET MVC


• Event Driven development model • MVC Pattern development model
• Server Controls • Html Helpers
• Follows Web Forms Syntax • Follows WebForms & Razor Syntax
• ViewState • ViewData, ViewBag
• Session • Session, TempData
• File-based Url Mapping • Route-based Url Mapping
• User Controls • Partial Views
• Not Open Source • Open Source
For ASP.NET Core Online Training : +91-999 123 502

Advantages of ASP.NET MVC


• Separation of concern
• Extensible and pluggable
• Light Weight
• TDD (Test Driven Development)
• URL Routing
• Better support for open source
• Supports ASP.NET features
For ASP.NET Core Online Training : +91-999 123 502

Web Application Components

Data Object

Logic Class

UI DOM
For ASP.NET Core Online Training : +91-999 123 502

MVC Pattern

Object Model

Class Controller

DOM View
For ASP.NET Core Online Training : +91-999 123 502

Model
Data Model
Business Model
Presentation Model
For ASP.NET Core Online Training : +91-999 123 502

View
Standard View
Strongly Typed View
Partial View
Layout
For ASP.NET Core Online Training : +91-999 123 502

Controller
C#, VB Class
Action Methods
Regular Methods
For ASP.NET Core Online Training : +91-999 123 502

Model-View-Controller Communication (Contd.)


Model
Changes
Presentation
Notification

Notification
Interaction
View Controller Interaction
Presentation

Eg. www.domain.com/Product/Edit/1
For ASP.NET Core Online Training : +91-999 123 502

MVC vs. 3-Tier


Model DAL

BAL
View Controller
PL
For ASP.NET Core Online Training : +91-999 123 502

MVC vs. 3-Tier

Model

View Controller

Presentation Tier
For ASP.NET Core Online Training : +91-999 123 502

Routing
• A pattern matching system that monitor the incoming
request and figure out what to do with that request
• Typically, a way to serve user request

Request
Routing

Controller Model
Response
View
For ASP.NET Core Online Training : +91-999 123 502

Types of Routing
For ASP.NET Core Online Training : +91-999 123 502

ASP.NET MVC Pipeline


For ASP.NET Core Online Training : +91-999 123 502

You might also like