SlideShare a Scribd company logo
Getting Started with ASP.NET MVC
HousekeepingStuttering is a communication disorder involving disruptions, or “disfluencies,” in a person’s speech.Across all cultures, roughly 1% of people currently has a stuttering disorder.http://westutter.org/
HattanShobokshiSenior Software Engineerwww.hattanshobokshi.comhattan@gmail.comhttp://speakerrate.com/hattanWho am I?
Goals for this talk Present an overview of ASP.NET MVCMVC vsWebforms. Why?What is the MVC paradigm?Controllers and Action MethodsViewsHtml HelpersModelsModel BindingRoutingBest Practices
A new web development framework that allows you to develop web applications on the Microsoft stack using an MVC Architecture.Is NOT a replacement for traditional ASP.NET web forms.Web Forms vs MVCCurrent Version is MVC3.MVC2 and MVC3 are extension of MVC1.MVC1 and MVC2  - .NET Framework 3.5 & 4.0MVC3 4.0 ONLYVisual Studio Tooling SupportConvention over configurationWhat is ASP.NET MVC
What is MVC?
Getting Started with ASP.NET MVC
Why should I use ASP.NET MVC? TestabilityModel Binder is awesome!No ViewstateSEO friendly url’sComplete control over Html outputEasier integration with JqueryBetter Separation of Concerns
ASP.NET Web FormsTraditional urlhttp://www.yoursite.com/admin/menu.aspx
ASP.NET MVChttp://www.yoursite.com/admin/menuAdmin is not a folder, but a class called AdminControllerMenu is not a file, but a Method in the AdminController Class
DEMO
RoutingRoute engine parses url’s, extracts any data and sends it off to controllerCreate extremely customizable routesRoute table defines routes  in global.asaxYou do not need to define a route to handle querystring parameters. They are automatically mapped.
Model The model is the representation of your data.Business Logic
ViewsNo Code behindAction methods by default call views with the same name. (Convention over configuration)Views are not tied to a specific action method or controller.Views should be dumb (shouldn’t contain any application logic, only rendering logic)Views can be strongly typed
Html HelpersHtml helpers are extension methods that generate html. @Html.TextBox(“Name”,”Bob”)Html helpers are NOT controls, they simply generate html markup (strings)You can create your own Html Helper.
Model BindingTakes data from an html form and creates an object.No need to write plumbing code
Best PracticesNever include a hard reference in the view(eg <script src=“../js/jquery.js”></script>)instead use url.content like so<script src=“<%=Url.Content(“~/js/jquery.js”)%>”></script>)Never have big if then else in view, put it in an html helperAdd namespace to web.config so you don’t have to keep referencing it on each pageThe difference between routing name and class name.
Where can I get it?http://www.asp.net/mvc/download/http://www.microsoft.com/express/Web/
Resourceshttp://www.asp.net/learn/mvc/http://www.asp.net/learn/mvc-videos/Pro ASP.NET MVC Framework by Steven SandersonAsp.net mvc Forumshttp://forums.asp.net/1146.aspxhttp://haacked.com/
What did we just talk about? Present an overview of ASP.NET MVC MVC vsWebforms. Why?What is the MVC paradigm?Controllers and Action MethodsViewsHtml HelpersModelsModel BindingRoutingBest Practices
The EndThank you!

More Related Content

What's hot (9)

PPT
Joomla Extensions Kung Fu
Oleg Nesterov
 
PPTX
Get satrted angular js
Alexandre Marreiros
 
PPTX
Angular js Classes in Pune
harshclassboat
 
PDF
W3 schools javascript quiz test
Himansu Sekhar Swain
 
PPTX
ASP.NET Web Forms vs. MVC
Harish Ranganathan
 
PPTX
Walther Mvc
rsnarayanan
 
PDF
Android MVVM
Vinícius Tonial Sossella
 
ODP
A Good PHP Framework For Beginners Like Me!
Muhammad Ghazali
 
PPTX
Android MVVM
David Estivariz Pierola
 
Joomla Extensions Kung Fu
Oleg Nesterov
 
Get satrted angular js
Alexandre Marreiros
 
Angular js Classes in Pune
harshclassboat
 
W3 schools javascript quiz test
Himansu Sekhar Swain
 
ASP.NET Web Forms vs. MVC
Harish Ranganathan
 
Walther Mvc
rsnarayanan
 
A Good PHP Framework For Beginners Like Me!
Muhammad Ghazali
 

Viewers also liked (6)

PPTX
ASP.NET MVC Best Practices malisa ncube
Malisa Ncube
 
PPTX
Asp.Net MVC Intro
Stefano Paluello
 
PPTX
Learning ASP.NET 5 and MVC 6
Ido Flatow
 
PPTX
ASP.NET MVC Performance
rudib
 
PDF
Model View Controller (MVC)
Javier Antonio Humarán Peñuñuri
 
PPTX
ASP.NET MVC Presentation
Volkan Uzun
 
ASP.NET MVC Best Practices malisa ncube
Malisa Ncube
 
Asp.Net MVC Intro
Stefano Paluello
 
Learning ASP.NET 5 and MVC 6
Ido Flatow
 
ASP.NET MVC Performance
rudib
 
Model View Controller (MVC)
Javier Antonio Humarán Peñuñuri
 
ASP.NET MVC Presentation
Volkan Uzun
 
Ad

Similar to Getting Started with ASP.NET MVC (20)

PPTX
Asp.net With mvc handson
Prashant Kumar
 
PPTX
Model view controller (mvc)
M Ahsan Khan
 
PPTX
Asp.net mvc presentation by Nitin Sawant
Nitin S
 
PPTX
Mvc
Furqan Ashraf
 
PPTX
Getting started with MVC 5 and Visual Studio 2013
Thomas Robbins
 
PPS
Introduction To Mvc
Volkan Uzun
 
PDF
MVC Interview Questions PDF By ScholarHat
Scholarhat
 
PPTX
Advanced MVC3
shobokshi
 
PPT
MVC ppt presentation
Bhavin Shah
 
PPT
MVC From Beginner to Advance in Indian Style by - Indiandotnet
Indiandotnet
 
PDF
ASP.NET MVC 2.0
Buu Nguyen
 
PPTX
Fast Track introduction to ASP.NET MVC
Ankit Kashyap
 
PPTX
ASPNet MVC series for beginers part 1
Gaurav Arora
 
PPTX
Asp net mvc series for beginers part 1
Gaurav Arora
 
PDF
Aspnetmvc 1
Fajar Baskoro
 
PDF
Asp 1a-aspnetmvc
Fajar Baskoro
 
PPTX
Intro ASP MVC
KrishnaPPatel
 
PPTX
MVC & SQL_In_1_Hour
Dilip Patel
 
PPTX
Aspnet mvc
Hiep Luong
 
PPTX
ASP.NET MVC Fundamental
ldcphuc
 
Asp.net With mvc handson
Prashant Kumar
 
Model view controller (mvc)
M Ahsan Khan
 
Asp.net mvc presentation by Nitin Sawant
Nitin S
 
Getting started with MVC 5 and Visual Studio 2013
Thomas Robbins
 
Introduction To Mvc
Volkan Uzun
 
MVC Interview Questions PDF By ScholarHat
Scholarhat
 
Advanced MVC3
shobokshi
 
MVC ppt presentation
Bhavin Shah
 
MVC From Beginner to Advance in Indian Style by - Indiandotnet
Indiandotnet
 
ASP.NET MVC 2.0
Buu Nguyen
 
Fast Track introduction to ASP.NET MVC
Ankit Kashyap
 
ASPNet MVC series for beginers part 1
Gaurav Arora
 
Asp net mvc series for beginers part 1
Gaurav Arora
 
Aspnetmvc 1
Fajar Baskoro
 
Asp 1a-aspnetmvc
Fajar Baskoro
 
Intro ASP MVC
KrishnaPPatel
 
MVC & SQL_In_1_Hour
Dilip Patel
 
Aspnet mvc
Hiep Luong
 
ASP.NET MVC Fundamental
ldcphuc
 
Ad

Recently uploaded (20)

PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PDF
Python basic programing language for automation
DanialHabibi2
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
July Patch Tuesday
Ivanti
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
Python basic programing language for automation
DanialHabibi2
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 

Getting Started with ASP.NET MVC

  • 1. Getting Started with ASP.NET MVC
  • 2. HousekeepingStuttering is a communication disorder involving disruptions, or “disfluencies,” in a person’s speech.Across all cultures, roughly 1% of people currently has a stuttering disorder.http://westutter.org/
  • 4. Goals for this talk Present an overview of ASP.NET MVCMVC vsWebforms. Why?What is the MVC paradigm?Controllers and Action MethodsViewsHtml HelpersModelsModel BindingRoutingBest Practices
  • 5. A new web development framework that allows you to develop web applications on the Microsoft stack using an MVC Architecture.Is NOT a replacement for traditional ASP.NET web forms.Web Forms vs MVCCurrent Version is MVC3.MVC2 and MVC3 are extension of MVC1.MVC1 and MVC2 - .NET Framework 3.5 & 4.0MVC3 4.0 ONLYVisual Studio Tooling SupportConvention over configurationWhat is ASP.NET MVC
  • 8. Why should I use ASP.NET MVC? TestabilityModel Binder is awesome!No ViewstateSEO friendly url’sComplete control over Html outputEasier integration with JqueryBetter Separation of Concerns
  • 9. ASP.NET Web FormsTraditional urlhttp://www.yoursite.com/admin/menu.aspx
  • 10. ASP.NET MVChttp://www.yoursite.com/admin/menuAdmin is not a folder, but a class called AdminControllerMenu is not a file, but a Method in the AdminController Class
  • 11. DEMO
  • 12. RoutingRoute engine parses url’s, extracts any data and sends it off to controllerCreate extremely customizable routesRoute table defines routes in global.asaxYou do not need to define a route to handle querystring parameters. They are automatically mapped.
  • 13. Model The model is the representation of your data.Business Logic
  • 14. ViewsNo Code behindAction methods by default call views with the same name. (Convention over configuration)Views are not tied to a specific action method or controller.Views should be dumb (shouldn’t contain any application logic, only rendering logic)Views can be strongly typed
  • 15. Html HelpersHtml helpers are extension methods that generate html. @Html.TextBox(“Name”,”Bob”)Html helpers are NOT controls, they simply generate html markup (strings)You can create your own Html Helper.
  • 16. Model BindingTakes data from an html form and creates an object.No need to write plumbing code
  • 17. Best PracticesNever include a hard reference in the view(eg <script src=“../js/jquery.js”></script>)instead use url.content like so<script src=“<%=Url.Content(“~/js/jquery.js”)%>”></script>)Never have big if then else in view, put it in an html helperAdd namespace to web.config so you don’t have to keep referencing it on each pageThe difference between routing name and class name.
  • 18. Where can I get it?http://www.asp.net/mvc/download/http://www.microsoft.com/express/Web/
  • 19. Resourceshttp://www.asp.net/learn/mvc/http://www.asp.net/learn/mvc-videos/Pro ASP.NET MVC Framework by Steven SandersonAsp.net mvc Forumshttp://forums.asp.net/1146.aspxhttp://haacked.com/
  • 20. What did we just talk about? Present an overview of ASP.NET MVC MVC vsWebforms. Why?What is the MVC paradigm?Controllers and Action MethodsViewsHtml HelpersModelsModel BindingRoutingBest Practices

Editor's Notes

  • #7: Controller gets data from the model, Gives it to a view.Controller doesn’t care where model gets data, and likewise controller doesn’t care how the view renders.Each component only cares about itself. Easy to swap out.Benefits :Separation of ConcernsTestabilityEasy to modifyLack of ComplexityFlow:Request comes through. Controller class handles the request, fetching data from the model. Controller then sends that data to the View and the result is given to the framework for rendering