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

PPTX
Extreme optimization good
PDF
Five Common Angular Mistakes
PDF
Principles of MVC for PHP Developers
PPT
Successful Teams follow Standards
PPTX
Html 5 a step towards semantic web
PPTX
Using HTML5 and CSS3 today
PPTX
Mvvm pattern
PPTX
Joomla Frameworks Kung Fu
Extreme optimization good
Five Common Angular Mistakes
Principles of MVC for PHP Developers
Successful Teams follow Standards
Html 5 a step towards semantic web
Using HTML5 and CSS3 today
Mvvm pattern
Joomla Frameworks Kung Fu

What's hot (9)

PPT
Joomla Extensions Kung Fu
PPTX
Get satrted angular js
PPTX
Angular js Classes in Pune
PDF
W3 schools javascript quiz test
PPTX
ASP.NET Web Forms vs. MVC
PPTX
Walther Mvc
PDF
ODP
A Good PHP Framework For Beginners Like Me!
PPTX
Joomla Extensions Kung Fu
Get satrted angular js
Angular js Classes in Pune
W3 schools javascript quiz test
ASP.NET Web Forms vs. MVC
Walther Mvc
A Good PHP Framework For Beginners Like Me!
Ad

Viewers also liked (6)

PPTX
ASP.NET MVC Best Practices malisa ncube
PPTX
Asp.Net MVC Intro
PPTX
Learning ASP.NET 5 and MVC 6
PPTX
ASP.NET MVC Performance
PDF
Model View Controller (MVC)
PPTX
ASP.NET MVC Presentation
ASP.NET MVC Best Practices malisa ncube
Asp.Net MVC Intro
Learning ASP.NET 5 and MVC 6
ASP.NET MVC Performance
Model View Controller (MVC)
ASP.NET MVC Presentation
Ad

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

PDF
MVC Interview Questions PDF By ScholarHat
PPS
Introduction To Mvc
PPT
MSDN - ASP.NET MVC
PDF
Php and-mvc
PPTX
Which is better asp.net mvc vs asp.net
PDF
Object Oriented Programming with Laravel - Session 3
PPT
ASP.NET MVC Presentation
PPTX
Pcs global (4)
PPTX
ASP.NET MVC 3
PPT
TDD with ASP.NET MVC 1.0
PPT
MVC
PPT
MVC From Beginner to Advance in Indian Style by - Indiandotnet
PPT
ASP.net MVC CodeCamp Presentation
ODP
Worry free web development
PPTX
MongoDB.local Dallas 2019: MongoDB Stitch Tutorial
PPT
ASP.NET MVC introduction
PPT
MVC Demystified: Essence of Ruby on Rails
DOCX
report_vendor_connect
PDF
ASP.NET MVC 5 Building Your First Web Application (A Beginner S Guide
MVC Interview Questions PDF By ScholarHat
Introduction To Mvc
MSDN - ASP.NET MVC
Php and-mvc
Which is better asp.net mvc vs asp.net
Object Oriented Programming with Laravel - Session 3
ASP.NET MVC Presentation
Pcs global (4)
ASP.NET MVC 3
TDD with ASP.NET MVC 1.0
MVC
MVC From Beginner to Advance in Indian Style by - Indiandotnet
ASP.net MVC CodeCamp Presentation
Worry free web development
MongoDB.local Dallas 2019: MongoDB Stitch Tutorial
ASP.NET MVC introduction
MVC Demystified: Essence of Ruby on Rails
report_vendor_connect
ASP.NET MVC 5 Building Your First Web Application (A Beginner S Guide

Recently uploaded (20)

PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Machine Learning_overview_presentation.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Approach and Philosophy of On baking technology
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
MIND Revenue Release Quarter 2 2025 Press Release
Machine Learning_overview_presentation.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
A comparative analysis of optical character recognition models for extracting...
Review of recent advances in non-invasive hemoglobin estimation
Approach and Philosophy of On baking technology
Unlocking AI with Model Context Protocol (MCP)
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Per capita expenditure prediction using model stacking based on satellite ima...
Building Integrated photovoltaic BIPV_UPV.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
sap open course for s4hana steps from ECC to s4
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf

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