SlideShare a Scribd company logo
Shiju Varghese http://weblogs.asp.net/shijuvarghese
Session Objectives Introduction to ASP.NET MVC Demonstrate programming  using ASP.NET MVC
What’s wrong with ASP.NET WebForm ViewState Page life cycle Limited control over rendered HTML Lack of Separation of Concerns (SoC) Untestable
What is MVC A design pattern Acronym for Model View Controller Isolating business logic from UI Layering for UI layer Separation of Concerns (SoC) Separate content from presentation and data-processing (model) from content
What is MVC View is just concerned about presentation logic Models represent the data Controllers just handle application flow  You write less code and end up with a more maintainable application.
Why a new model A lot of developers asking for it. Simpler way to program ASP.NET Enable separation of concerns and testability Model-view-controller presentation pattern is a time-tested pattern that scales with size and complexity Complete control over Html generated
What is ASP.NET MVC An alternative framework to ASP.NET Web Forms. More control over your HTML A more easily testable framework Simply an option Will not a replacement for Web Form Build on top of ASP.NET Opinionated Framework Community Driven Framework Source code on CodePlex
Goals of ASP.NET MVC Framework Enable clean separation of concerns Each component has one responsibility Single Responsibility Principle (SRP) Highly testable and maintainable application Testable by default (built with TDD in mind) Red/Green/Refactor TDD  Enable full control over the rendered HTML Enable clean URLs and HTML SEO and REST friendly URL structures
Goals of ASP.NET MVC Framework Extensible and Pluggable framework. Interface-based architecture Support replacing any component of the system Support third-party view engines such as NVelocity, Brail, NHaml  Support user-provided front controller that enable Inversion of Control containers Build on top of ASP.NET Support static and dynamic languages Conventions and Guidance
ASP.NET MVC doesn’t have Postbacks View state Control state Server-side form Page/Control lifecycle
ASP.NET MVC still has… Web designer Master pages User controls Membership/Roles/Profile Globalization Caching HTTP intrinsics objects
URL Routing  Browser Request is mapped to controller action through URL Routing. URL Routing route the incoming requests to controller actions. URL Routing uses Route Table that will be created when application first starts. Route table is setup in the Global.asax file.
URL Routing
How it works Browser List.aspx (View) Web Server CategoryController (Controller) http://myserver.com/category/List http://myserver.com/category/Edit/5 Edit.aspx (View) Database Employeee (Model)
Request Flow Browser requests /Category/ Route is determined Controller is activated Method on Controller is invoke Controller does some stuff Renders View, passing in custom ViewData
Request Flow
Summary Not a replacement for WebForm Just an alternative option Not for everyone Build on top of ASP.NET Providers still work Membership, Caching, Session Views leverage .aspx and .acx
Summary – Extensible Framework Replace any part with your own All are pluggable Views Controllers Models Routes
Summary - Clean URL Structure REST based Architecture Fits with the nature of the Web ASP.NET MVC exposes the stateless nature of HTTP Search Engine Optimization (SEO)
Showcase of  live ASP.NET MVC application http:// stackoverflow.com / A Web 2.0 application Q & A website for developers Blend of  Wikis, Blogs, Forums, and Digg/Reddit  Oxite Microsoft’s open source platform for CMS/Blog Used to develop MIX Online ( http://visitmix.com )
ASP.NET MVC Versus WebForm Web Form Big Design Up Front (BDUF) methodology RAD and WinForm programming experience MVC Not doing Big Design Up Front (BDUF)  “ Close to the Metal” Programming Experience
ASP.NET MVC Versus WebForm Web Forms ViewState, Page Execution Lifecycle, Postback Services Not Easy to Test Not Easy to Search (SEO) MVC No ViewState, Page Execution Lifecycle, Postback Services Highly Testable Easy Search (SEO)
Consider MVC model, If You want full control over HTML You want a framework that enforces separation of concerns TDD/Unit Testing is priority for you Control abstractions get in your way more than they help You want easy integration with JavaScript
Consider WebForms model, If You want programming against the reusable control abstractions that encapsulate UI and logic You want RAD and Windows Form development experience You want to develop heavy data-driven Line of Business (LOB) Applications.
You must use MVC model, If You want adopt agile methodology You are a DDD/TDD believer You want to develop public face internet applications and Web 2.0 applications
Resources ASP.NET MVC site -  http:// as.net/mvc Blogs Scott Guthrie http:// weblogs.asp.net/scottgu Phill Haack http:// haacked.com Stephen Walther http:// weblogs.asp.net/stephenwalther
Questions?
Thanks Shiju Varghese E-Mail :  [email_address] Blog :  http:// weblogs.asp.net/shijuvarghese Twitter :  http:// twitter.com/shijucv

More Related Content

What's hot (20)

PPTX
Asp.net MVC training session
Hrichi Mohamed
 
PDF
Asp.net mvc basic introduction
Bhagath Gopinath
 
PPTX
Asp.net mvc 5 course module 1 overview
Sergey Seletsky
 
PPTX
Introduction to ASP.NET
Rajkumarsoy
 
PPTX
ASP.NET Brief History
Sudhakar Sharma
 
PPTX
Asp.net mvc presentation by Nitin Sawant
Nitin S
 
PPTX
Introduction to ASP.NET MVC
Khaled Musaied
 
PPTX
MVC - Introduction
Sudhakar Sharma
 
ODP
Mvc
abhigad
 
PPTX
ASP .Net MVC 5
Nilachal sethi
 
PPTX
Mvc summary
Muhammad Younis
 
PPTX
ASP .NET MVC
eldorina
 
PPTX
A Gentle Introduction to Blazor
Jose Javier Columbie
 
PDF
Asp 1a-aspnetmvc
Fajar Baskoro
 
PDF
Introduction to ASP.NET MVC
Sirwan Afifi
 
PPSX
Asp.net mvc
Er. Kamal Bhusal
 
PPTX
Introduction to asp.net
shan km
 
PPT
Asp.net mvc
Naga Harish M
 
PPTX
Web changesandasp4 upload
READIFY
 
PPTX
ASP.NET 5
David Voyles
 
Asp.net MVC training session
Hrichi Mohamed
 
Asp.net mvc basic introduction
Bhagath Gopinath
 
Asp.net mvc 5 course module 1 overview
Sergey Seletsky
 
Introduction to ASP.NET
Rajkumarsoy
 
ASP.NET Brief History
Sudhakar Sharma
 
Asp.net mvc presentation by Nitin Sawant
Nitin S
 
Introduction to ASP.NET MVC
Khaled Musaied
 
MVC - Introduction
Sudhakar Sharma
 
Mvc
abhigad
 
ASP .Net MVC 5
Nilachal sethi
 
Mvc summary
Muhammad Younis
 
ASP .NET MVC
eldorina
 
A Gentle Introduction to Blazor
Jose Javier Columbie
 
Asp 1a-aspnetmvc
Fajar Baskoro
 
Introduction to ASP.NET MVC
Sirwan Afifi
 
Asp.net mvc
Er. Kamal Bhusal
 
Introduction to asp.net
shan km
 
Asp.net mvc
Naga Harish M
 
Web changesandasp4 upload
READIFY
 
ASP.NET 5
David Voyles
 

Similar to Introduction to ASP.NET MVC 1.0 (20)

PPTX
ASP.NET Presentation
Rasel Khan
 
PPTX
Mvc presentation
MaslowB
 
PPT
MVC Architecture in ASP.Net By Nyros Developer
Nyros Technologies
 
PPTX
MVC Framework
Ashton Feller
 
PPTX
ASP.net MVC Introduction Wikilogia (nov 2014)
Hatem Hamad
 
PPS
Introduction To Mvc
Volkan Uzun
 
PPT
Asp.net,mvc
Prashant Kumar
 
PPTX
Aspnet mvc
Hiep Luong
 
PPTX
Introduction to ASP.Net MVC
Sagar Kamate
 
PPTX
Mvc part 1
Gandhi Ghanashyam
 
DOCX
A report on mvc using the information
Toushik Paul
 
PDF
Introduction to ASP.NET MVC
Mayank Srivastava
 
PDF
Aspnetmvc 1
Fajar Baskoro
 
PPTX
Intro ASP MVC
KrishnaPPatel
 
PPTX
Session 1
Asif Atick
 
PPTX
Which is better asp.net mvc vs asp.net
Concetto Labs
 
PPTX
Model view controller (mvc)
M Ahsan Khan
 
PPTX
MVC 4
Vasilios Kuznos
 
PPT
MSDN - ASP.NET MVC
Maarten Balliauw
 
ASP.NET Presentation
Rasel Khan
 
Mvc presentation
MaslowB
 
MVC Architecture in ASP.Net By Nyros Developer
Nyros Technologies
 
MVC Framework
Ashton Feller
 
ASP.net MVC Introduction Wikilogia (nov 2014)
Hatem Hamad
 
Introduction To Mvc
Volkan Uzun
 
Asp.net,mvc
Prashant Kumar
 
Aspnet mvc
Hiep Luong
 
Introduction to ASP.Net MVC
Sagar Kamate
 
Mvc part 1
Gandhi Ghanashyam
 
A report on mvc using the information
Toushik Paul
 
Introduction to ASP.NET MVC
Mayank Srivastava
 
Aspnetmvc 1
Fajar Baskoro
 
Intro ASP MVC
KrishnaPPatel
 
Session 1
Asif Atick
 
Which is better asp.net mvc vs asp.net
Concetto Labs
 
Model view controller (mvc)
M Ahsan Khan
 
MSDN - ASP.NET MVC
Maarten Balliauw
 
Ad

More from Shiju Varghese (20)

PDF
Building Modern Distributed Applications in Go with Service Weaver
Shiju Varghese
 
PDF
Microservices in Go with Go kit
Shiju Varghese
 
PDF
NATS: A Cloud Native Messaging System
Shiju Varghese
 
PDF
Event-Driven Microservices With NATS Streaming
Shiju Varghese
 
PDF
Inter-Process Communication in Microservices using gRPC
Shiju Varghese
 
PDF
Building Microservices with gRPC and NATS
Shiju Varghese
 
PDF
Building High Performance APIs In Go Using gRPC And Protocol Buffers
Shiju Varghese
 
PDF
Building Scalable Backends with Go
Shiju Varghese
 
PDF
A Primer to Containerization & Microservices
Shiju Varghese
 
PDF
Writing HTTP Middleware In Go
Shiju Varghese
 
PDF
Building RESTful Services With Go and MongoDB
Shiju Varghese
 
PDF
Docker and Kubernetes
Shiju Varghese
 
PDF
Practicing Mindfulness
Shiju Varghese
 
PPSX
Azure DocumentDB
Shiju Varghese
 
PPSX
Azure Mobile Services .NET Backend
Shiju Varghese
 
PDF
Windows Azure Mobile Services
Shiju Varghese
 
PDF
JavaScript, Meet Cloud : Node.js on Windows Azure
Shiju Varghese
 
PPSX
Introduction to Node js
Shiju Varghese
 
PPSX
Windows Azure Cloud Services
Shiju Varghese
 
PPSX
Windows Azure Webs Sites
Shiju Varghese
 
Building Modern Distributed Applications in Go with Service Weaver
Shiju Varghese
 
Microservices in Go with Go kit
Shiju Varghese
 
NATS: A Cloud Native Messaging System
Shiju Varghese
 
Event-Driven Microservices With NATS Streaming
Shiju Varghese
 
Inter-Process Communication in Microservices using gRPC
Shiju Varghese
 
Building Microservices with gRPC and NATS
Shiju Varghese
 
Building High Performance APIs In Go Using gRPC And Protocol Buffers
Shiju Varghese
 
Building Scalable Backends with Go
Shiju Varghese
 
A Primer to Containerization & Microservices
Shiju Varghese
 
Writing HTTP Middleware In Go
Shiju Varghese
 
Building RESTful Services With Go and MongoDB
Shiju Varghese
 
Docker and Kubernetes
Shiju Varghese
 
Practicing Mindfulness
Shiju Varghese
 
Azure DocumentDB
Shiju Varghese
 
Azure Mobile Services .NET Backend
Shiju Varghese
 
Windows Azure Mobile Services
Shiju Varghese
 
JavaScript, Meet Cloud : Node.js on Windows Azure
Shiju Varghese
 
Introduction to Node js
Shiju Varghese
 
Windows Azure Cloud Services
Shiju Varghese
 
Windows Azure Webs Sites
Shiju Varghese
 
Ad

Recently uploaded (20)

PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
Advancing WebDriver BiDi support in WebKit
Igalia
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Biography of Daniel Podor.pdf
Daniel Podor
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Advancing WebDriver BiDi support in WebKit
Igalia
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Biography of Daniel Podor.pdf
Daniel Podor
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 

Introduction to ASP.NET MVC 1.0

  • 2. Session Objectives Introduction to ASP.NET MVC Demonstrate programming using ASP.NET MVC
  • 3. What’s wrong with ASP.NET WebForm ViewState Page life cycle Limited control over rendered HTML Lack of Separation of Concerns (SoC) Untestable
  • 4. What is MVC A design pattern Acronym for Model View Controller Isolating business logic from UI Layering for UI layer Separation of Concerns (SoC) Separate content from presentation and data-processing (model) from content
  • 5. What is MVC View is just concerned about presentation logic Models represent the data Controllers just handle application flow You write less code and end up with a more maintainable application.
  • 6. Why a new model A lot of developers asking for it. Simpler way to program ASP.NET Enable separation of concerns and testability Model-view-controller presentation pattern is a time-tested pattern that scales with size and complexity Complete control over Html generated
  • 7. What is ASP.NET MVC An alternative framework to ASP.NET Web Forms. More control over your HTML A more easily testable framework Simply an option Will not a replacement for Web Form Build on top of ASP.NET Opinionated Framework Community Driven Framework Source code on CodePlex
  • 8. Goals of ASP.NET MVC Framework Enable clean separation of concerns Each component has one responsibility Single Responsibility Principle (SRP) Highly testable and maintainable application Testable by default (built with TDD in mind) Red/Green/Refactor TDD Enable full control over the rendered HTML Enable clean URLs and HTML SEO and REST friendly URL structures
  • 9. Goals of ASP.NET MVC Framework Extensible and Pluggable framework. Interface-based architecture Support replacing any component of the system Support third-party view engines such as NVelocity, Brail, NHaml Support user-provided front controller that enable Inversion of Control containers Build on top of ASP.NET Support static and dynamic languages Conventions and Guidance
  • 10. ASP.NET MVC doesn’t have Postbacks View state Control state Server-side form Page/Control lifecycle
  • 11. ASP.NET MVC still has… Web designer Master pages User controls Membership/Roles/Profile Globalization Caching HTTP intrinsics objects
  • 12. URL Routing Browser Request is mapped to controller action through URL Routing. URL Routing route the incoming requests to controller actions. URL Routing uses Route Table that will be created when application first starts. Route table is setup in the Global.asax file.
  • 14. How it works Browser List.aspx (View) Web Server CategoryController (Controller) http://myserver.com/category/List http://myserver.com/category/Edit/5 Edit.aspx (View) Database Employeee (Model)
  • 15. Request Flow Browser requests /Category/ Route is determined Controller is activated Method on Controller is invoke Controller does some stuff Renders View, passing in custom ViewData
  • 17. Summary Not a replacement for WebForm Just an alternative option Not for everyone Build on top of ASP.NET Providers still work Membership, Caching, Session Views leverage .aspx and .acx
  • 18. Summary – Extensible Framework Replace any part with your own All are pluggable Views Controllers Models Routes
  • 19. Summary - Clean URL Structure REST based Architecture Fits with the nature of the Web ASP.NET MVC exposes the stateless nature of HTTP Search Engine Optimization (SEO)
  • 20. Showcase of live ASP.NET MVC application http:// stackoverflow.com / A Web 2.0 application Q & A website for developers Blend of Wikis, Blogs, Forums, and Digg/Reddit Oxite Microsoft’s open source platform for CMS/Blog Used to develop MIX Online ( http://visitmix.com )
  • 21. ASP.NET MVC Versus WebForm Web Form Big Design Up Front (BDUF) methodology RAD and WinForm programming experience MVC Not doing Big Design Up Front (BDUF) “ Close to the Metal” Programming Experience
  • 22. ASP.NET MVC Versus WebForm Web Forms ViewState, Page Execution Lifecycle, Postback Services Not Easy to Test Not Easy to Search (SEO) MVC No ViewState, Page Execution Lifecycle, Postback Services Highly Testable Easy Search (SEO)
  • 23. Consider MVC model, If You want full control over HTML You want a framework that enforces separation of concerns TDD/Unit Testing is priority for you Control abstractions get in your way more than they help You want easy integration with JavaScript
  • 24. Consider WebForms model, If You want programming against the reusable control abstractions that encapsulate UI and logic You want RAD and Windows Form development experience You want to develop heavy data-driven Line of Business (LOB) Applications.
  • 25. You must use MVC model, If You want adopt agile methodology You are a DDD/TDD believer You want to develop public face internet applications and Web 2.0 applications
  • 26. Resources ASP.NET MVC site - http:// as.net/mvc Blogs Scott Guthrie http:// weblogs.asp.net/scottgu Phill Haack http:// haacked.com Stephen Walther http:// weblogs.asp.net/stephenwalther
  • 28. Thanks Shiju Varghese E-Mail : [email_address] Blog : http:// weblogs.asp.net/shijuvarghese Twitter : http:// twitter.com/shijucv