SlideShare a Scribd company logo
Introduction to ASP.NET MVC
Agenda What's MVC  What's ASP.NET MVC  Goals of ASP.NET MVC   How does it work?
What's MVC View Model Controller Defines application behavior Maps user action to model Select view to response Represent enterprise data Business rules that govern access/update data Render content of model
What's ASP.NET MVC New framework from Microsoft that builds on top standard ASP.NET engine ASP.NET   Web Form ASP.NET MVC Core standard ASP . NET engine Microsoft .NET Framework
Goals of ASP.NET MVC Testability Pluggable Friendly URLs (REST URL) Existing ASP.NET feature still available Full control of HTML Open source
ASP.NET MVC ASP.NET MVC 1.0 (Dec, 2008) ASP.NET MVC 2.0 Beta (Nov, 2009)
ASP.NET MVC .NET Framework 3.5 Visual Studio 2008 (service pack 1)  Download ( asp.net/mvc ) Visual Studio 2010 (included)
Demo: Hello World
Controller is responsible for handling incoming request  Routing system decides how URLs map into particular controllers and actions How does it work? Action in controller Controller http://localhost:1725/ Hello / ActionTest
Component is first hit by a request The rules are configured in Global.asax Routing public static void RegisterRoutes(RouteCollection routes) {   routes.MapRoute( "Default",  "{ controller }/{ action }/{ id }",  new { controller = "Home", action = "Index", id = "" } ); } http://localhost:1725/ Product / Show / 1
Demo: Model with Strong type
Request Flow Request View Controller Model HTTP Select View HTML Routing Select Controller
Demo: HTMLHelper
Provide method for creating HTML control Support Strong-type HTML Helper <%= Html. TextBoxFor (model => model. Body ) %> <input type=“text” name=“ Body ” id=“ Body ” />
Request variable Action method parameter ModelBinder Handling post request Public ActionResult Create()  { string subject =  Request.Form[“Subject”]; } Public ActionResult Create( string Subject )  { // do something } Public ActionResult Create( Commentary commentary )  { // do something }
Demo: Form & Validation
Validation Define Validation in Model Server Side Validation Client Side Validation ModelState  Class to keep state of model   Data  Annotation  Model Binder Java script
Summary RESTful URL Complex URL F ull control over   HTML Clean HTML Event - driven programming (Drag n’ drop) Design for testing Cannot test easily Separation of Concerns Combines code and view ASP.NET MVC ASP.NET WebForms
Q & A

More Related Content

PPT
Model Binding In ASP.NET MVC
Mindfire Solutions
 
PDF
Asp.net mvc basic introduction
Bhagath Gopinath
 
ODP
Mvc
abhigad
 
PPTX
Mortal Kombat! ASP.NET MVC vs ASP.NET Webforms – ASP.NET MVC is amazing
Tom Walker
 
PPTX
Mvc framework
Dhurham Fahem
 
PPTX
Introduction to ASP.NET MVC
Emad Alashi
 
PDF
Dot net interview questions and asnwers
kavinilavuG
 
PPT
Asp.net mvc
Naga Harish M
 
Model Binding In ASP.NET MVC
Mindfire Solutions
 
Asp.net mvc basic introduction
Bhagath Gopinath
 
Mvc
abhigad
 
Mortal Kombat! ASP.NET MVC vs ASP.NET Webforms – ASP.NET MVC is amazing
Tom Walker
 
Mvc framework
Dhurham Fahem
 
Introduction to ASP.NET MVC
Emad Alashi
 
Dot net interview questions and asnwers
kavinilavuG
 
Asp.net mvc
Naga Harish M
 

What's hot (20)

PPTX
MVC architecture by Mohd.Awais on 18th Aug, 2017
Innovation Studio
 
PPTX
Mvc fundamental
Nguyễn Thành Phát
 
PPT
MVC Architecture in ASP.Net By Nyros Developer
Nyros Technologies
 
PPTX
ASP .Net MVC 5
Nilachal sethi
 
PPT
MSDN - ASP.NET MVC
Maarten Balliauw
 
PPTX
Introduction to mvc architecture
ravindraquicsolv
 
PDF
MVC architecture
Emily Bauman
 
PPTX
Mvc presentation
MaslowB
 
PDF
MVC Architecture
Prem Sanil
 
ODP
What is MVC?
Dom Cimafranca
 
PPTX
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe
 
PPTX
Mvc Brief Overview
rainynovember12
 
PPTX
Getting started with MVC 5 and Visual Studio 2013
Thomas Robbins
 
PPT
Silver Light By Nyros Developer
Nyros Technologies
 
PPTX
Module2
Hoàng Lê
 
PPTX
4. Introduction to ASP.NET MVC - Part I
Rohit Rao
 
PPT
ASP.NET MVC Presentation
ivpol
 
PPTX
Asp.net MVC training session
Hrichi Mohamed
 
MVC architecture by Mohd.Awais on 18th Aug, 2017
Innovation Studio
 
Mvc fundamental
Nguyễn Thành Phát
 
MVC Architecture in ASP.Net By Nyros Developer
Nyros Technologies
 
ASP .Net MVC 5
Nilachal sethi
 
MSDN - ASP.NET MVC
Maarten Balliauw
 
Introduction to mvc architecture
ravindraquicsolv
 
MVC architecture
Emily Bauman
 
Mvc presentation
MaslowB
 
MVC Architecture
Prem Sanil
 
What is MVC?
Dom Cimafranca
 
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe
 
Mvc Brief Overview
rainynovember12
 
Getting started with MVC 5 and Visual Studio 2013
Thomas Robbins
 
Silver Light By Nyros Developer
Nyros Technologies
 
Module2
Hoàng Lê
 
4. Introduction to ASP.NET MVC - Part I
Rohit Rao
 
ASP.NET MVC Presentation
ivpol
 
Asp.net MVC training session
Hrichi Mohamed
 
Ad

Similar to Introduction to ASP.NET MVC (20)

PPT
ASP.NET 4 and AJAX
KulveerSingh
 
PPTX
Asp.Net MVC Intro
Stefano Paluello
 
PDF
Build your website with angularjs and web apis
Chalermpon Areepong
 
PPTX
8-9-10. ASP_updated8-9-10. ASP_updated8-9-10. ASP_updated
dioduong345
 
PPTX
Walther Aspnet4
rsnarayanan
 
PPT
ASP.NET MVC introduction
Tomi Juhola
 
PPT
CTTDNUG ASP.NET MVC
Barry Gervin
 
PPT
Asp.Net Ajax Component Development
Chui-Wen Chiu
 
PPTX
Web api
udaiappa
 
PPT
Spring MVC
yuvalb
 
PPTX
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
SharePoint Saturday NY
 
PPS
Introduction To Mvc
Volkan Uzun
 
PPT
ASP.NET AJAX with Visual Studio 2008
Caleb Jenkins
 
PPT
Introduction To ASP.NET MVC
Alan Dean
 
PPT
Introduction to ASP.NET MVC
Maarten Balliauw
 
PPTX
ASP.NET MVC
Paul Stovell
 
PPTX
Asp.net mvc
erdemergin
 
PPT
AspMVC4 start101
Rich Helton
 
PPT
ASP.NET 4.0 Roadmap
Harish Ranganathan
 
PPTX
Usability AJAX and other ASP.NET Features
Peter Gfader
 
ASP.NET 4 and AJAX
KulveerSingh
 
Asp.Net MVC Intro
Stefano Paluello
 
Build your website with angularjs and web apis
Chalermpon Areepong
 
8-9-10. ASP_updated8-9-10. ASP_updated8-9-10. ASP_updated
dioduong345
 
Walther Aspnet4
rsnarayanan
 
ASP.NET MVC introduction
Tomi Juhola
 
CTTDNUG ASP.NET MVC
Barry Gervin
 
Asp.Net Ajax Component Development
Chui-Wen Chiu
 
Web api
udaiappa
 
Spring MVC
yuvalb
 
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
SharePoint Saturday NY
 
Introduction To Mvc
Volkan Uzun
 
ASP.NET AJAX with Visual Studio 2008
Caleb Jenkins
 
Introduction To ASP.NET MVC
Alan Dean
 
Introduction to ASP.NET MVC
Maarten Balliauw
 
ASP.NET MVC
Paul Stovell
 
Asp.net mvc
erdemergin
 
AspMVC4 start101
Rich Helton
 
ASP.NET 4.0 Roadmap
Harish Ranganathan
 
Usability AJAX and other ASP.NET Features
Peter Gfader
 
Ad

Recently uploaded (20)

PPTX
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Software Development Company | KodekX
KodekX
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
Doc9.....................................
SofiaCollazos
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PPTX
Coupa-Overview _Assumptions presentation
annapureddyn
 
PDF
Why Your AI & Cybersecurity Hiring Still Misses the Mark in 2025
Virtual Employee Pvt. Ltd.
 
PDF
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
PDF
Chapter 1 Introduction to CV and IP Lecture Note.pdf
Getnet Tigabie Askale -(GM)
 
PDF
Building High-Performance Oracle Teams: Strategic Staffing for Database Manag...
SMACT Works
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PPTX
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
PDF
This slide provides an overview Technology
mineshkharadi333
 
PDF
DevOps & Developer Experience Summer BBQ
AUGNYC
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
PDF
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Software Development Company | KodekX
KodekX
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
Doc9.....................................
SofiaCollazos
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Coupa-Overview _Assumptions presentation
annapureddyn
 
Why Your AI & Cybersecurity Hiring Still Misses the Mark in 2025
Virtual Employee Pvt. Ltd.
 
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
Chapter 1 Introduction to CV and IP Lecture Note.pdf
Getnet Tigabie Askale -(GM)
 
Building High-Performance Oracle Teams: Strategic Staffing for Database Manag...
SMACT Works
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
This slide provides an overview Technology
mineshkharadi333
 
DevOps & Developer Experience Summer BBQ
AUGNYC
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 

Introduction to ASP.NET MVC

  • 2. Agenda What's MVC What's ASP.NET MVC Goals of ASP.NET MVC How does it work?
  • 3. What's MVC View Model Controller Defines application behavior Maps user action to model Select view to response Represent enterprise data Business rules that govern access/update data Render content of model
  • 4. What's ASP.NET MVC New framework from Microsoft that builds on top standard ASP.NET engine ASP.NET Web Form ASP.NET MVC Core standard ASP . NET engine Microsoft .NET Framework
  • 5. Goals of ASP.NET MVC Testability Pluggable Friendly URLs (REST URL) Existing ASP.NET feature still available Full control of HTML Open source
  • 6. ASP.NET MVC ASP.NET MVC 1.0 (Dec, 2008) ASP.NET MVC 2.0 Beta (Nov, 2009)
  • 7. ASP.NET MVC .NET Framework 3.5 Visual Studio 2008 (service pack 1) Download ( asp.net/mvc ) Visual Studio 2010 (included)
  • 9. Controller is responsible for handling incoming request Routing system decides how URLs map into particular controllers and actions How does it work? Action in controller Controller http://localhost:1725/ Hello / ActionTest
  • 10. Component is first hit by a request The rules are configured in Global.asax Routing public static void RegisterRoutes(RouteCollection routes) { routes.MapRoute( &quot;Default&quot;, &quot;{ controller }/{ action }/{ id }&quot;, new { controller = &quot;Home&quot;, action = &quot;Index&quot;, id = &quot;&quot; } ); } http://localhost:1725/ Product / Show / 1
  • 11. Demo: Model with Strong type
  • 12. Request Flow Request View Controller Model HTTP Select View HTML Routing Select Controller
  • 14. Provide method for creating HTML control Support Strong-type HTML Helper <%= Html. TextBoxFor (model => model. Body ) %> <input type=“text” name=“ Body ” id=“ Body ” />
  • 15. Request variable Action method parameter ModelBinder Handling post request Public ActionResult Create() { string subject = Request.Form[“Subject”]; } Public ActionResult Create( string Subject ) { // do something } Public ActionResult Create( Commentary commentary ) { // do something }
  • 16. Demo: Form & Validation
  • 17. Validation Define Validation in Model Server Side Validation Client Side Validation ModelState Class to keep state of model Data Annotation Model Binder Java script
  • 18. Summary RESTful URL Complex URL F ull control over   HTML Clean HTML Event - driven programming (Drag n’ drop) Design for testing Cannot test easily Separation of Concerns Combines code and view ASP.NET MVC ASP.NET WebForms
  • 19. Q & A

Editor's Notes

  • #4: Main purpose of mvc is to isolate business logic from user interface pros - Better maintain - Testable - Cleaner code
  • #6: Testability - Framework provides interface-base  easy to mackable Pluggable - Every component can easy replaced or customize (view replaced with ironPython) - Easy to use dependency injection design pattern (unity, spring) Friendly URL - Can build app for search engine friendly Existing ASP,NET feature still available - All exist asp.net feature still available ex: Master.Page, User Control, Session, Memberdhip - But ViewState and page life cycle are not support Full control of HTML - Write only html - no viewstate Open source - under MS-PL license
  • #9: Demo from empty project Show create view and run Show ViewData and run Demo TDD hello world
  • #10: Controller is responsible for handling incoming request - All public method that implement by Controller class, It can be invoke from web via url.
  • #11: Controller is responsible for handling incoming request - All public method that implement by Controller class, It can be invoke from web via url.
  • #12: Demo new template project Modify routing default to commentary Create model Commentary Create Commentary controller Create View Show F5 Create Method Details Use Model.Subject
  • #14: Demo new template project Modify routing default to commentary Create model Commentary Create Commentary controller Create View Show F5 Show feature for HTML helper Show JSON JsonRequestBehavior.AllowGet
  • #17: Show validation with statemodel Show validation with anotation in serverside Show validation with client
  • #18: Using ModelState Class =&gt; Encapsulates the state of model binding to a property of an action - method argument, or to the argument itself
  • #19: Uses the ‘Page Controller’ pattern . Each page has a code - behind class that acts as a controller and is responsible for rendering the layout . Uses the ‘Front Controller’ pattern. There is a single central controller for all pages to process web application requests and facilitates a rich routing architecture