SlideShare a Scribd company logo
Getting Started with ASP.NET MVC
Housekeeping Stuttering 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/
HattanShobokshi Senior Software Engineer www.hattanshobokshi.com hattan@gmail.com http://speakerrate.com/hattan Who am I?
Goals for this talk  Present an overview of ASP.NET MVC MVC vsWebforms. Why? What is the MVC paradigm? Controllers and Action Methods Views Html Helpers Models Model Binding Routing Best 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 MVC Current Version is MVC3. MVC2 and MVC3 are extension of MVC1. MVC1 and MVC2  - .NET Framework 3.5 & 4.0 MVC3 4.0 ONLY Visual Studio Tooling Support Convention over configuration What is ASP.NET MVC
What is MVC?
Why should I use ASP.NET MVC?  Testability Model Binder is awesome! No Viewstate SEO friendly url’s Complete control over Html output Easier integration with Jquery Better Separation of Concerns
ASP.NET Web Forms Traditional urlhttp://www.yoursite.com/admin/menu.aspx
ASP.NET MVC http://www.yoursite.com/admin/menu Admin is not a folder, but a class called AdminController Menu is not a file, but a Method in the AdminController Class
DEMO
Routing Route engine parses url’s, extracts any data and sends it off to controller Create extremely customizable routes Route table defines routes  in global.asax You 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
Views No Code behind Action 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 Helpers Html 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 Binding Takes data from an html form and creates an object. No need to write plumbing code
Best Practices Never 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 helper Add namespace to web.config so you don’t have to keep referencing it on each page The difference between routing name and class name.
Where can I get it? http://www.asp.net/mvc/download/ http://www.microsoft.com/express/Web/
Resources http://www.asp.net/learn/mvc/ http://www.asp.net/learn/mvc-videos/ Pro ASP.NET MVC Framework by Steven Sanderson Asp.net mvc Forumshttp://forums.asp.net/1146.aspx http://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 Methods Views Html Helpers Models Model Binding Routing Best Practices
The End Thank you!

More Related Content

What's hot

Joomla Extensions Kung Fu
Joomla Extensions Kung FuJoomla Extensions Kung Fu
Joomla Extensions Kung Fu
Oleg Nesterov
 
Get satrted angular js
Get satrted angular jsGet satrted angular js
Get satrted angular js
Alexandre Marreiros
 
Angular js Classes in Pune
Angular js Classes in PuneAngular js Classes in Pune
Angular js Classes in Pune
harshclassboat
 
W3 schools javascript quiz test
W3 schools javascript quiz testW3 schools javascript quiz test
W3 schools javascript quiz test
Himansu Sekhar Swain
 
ASP.NET Web Forms vs. MVC
ASP.NET Web Forms vs. MVCASP.NET Web Forms vs. MVC
ASP.NET Web Forms vs. MVC
Harish Ranganathan
 
Walther Mvc
Walther MvcWalther Mvc
Walther Mvc
rsnarayanan
 
Android MVVM
Android MVVMAndroid MVVM
A Good PHP Framework For Beginners Like Me!
A Good PHP Framework For Beginners Like Me!A Good PHP Framework For Beginners Like Me!
A Good PHP Framework For Beginners Like Me!
Muhammad Ghazali
 
Android MVVM
Android MVVMAndroid MVVM

What's hot (9)

Joomla Extensions Kung Fu
Joomla Extensions Kung FuJoomla Extensions Kung Fu
Joomla Extensions Kung Fu
 
Get satrted angular js
Get satrted angular jsGet satrted angular js
Get satrted angular js
 
Angular js Classes in Pune
Angular js Classes in PuneAngular js Classes in Pune
Angular js Classes in Pune
 
W3 schools javascript quiz test
W3 schools javascript quiz testW3 schools javascript quiz test
W3 schools javascript quiz test
 
ASP.NET Web Forms vs. MVC
ASP.NET Web Forms vs. MVCASP.NET Web Forms vs. MVC
ASP.NET Web Forms vs. MVC
 
Walther Mvc
Walther MvcWalther Mvc
Walther Mvc
 
Android MVVM
Android MVVMAndroid MVVM
Android MVVM
 
A Good PHP Framework For Beginners Like Me!
A Good PHP Framework For Beginners Like Me!A Good PHP Framework For Beginners Like Me!
A Good PHP Framework For Beginners Like Me!
 
Android MVVM
Android MVVMAndroid MVVM
Android MVVM
 

Viewers also liked

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

Viewers also liked (6)

ASP.NET MVC Best Practices malisa ncube
ASP.NET MVC Best Practices   malisa ncubeASP.NET MVC Best Practices   malisa ncube
ASP.NET MVC Best Practices malisa ncube
 
Asp.Net MVC Intro
Asp.Net MVC IntroAsp.Net MVC Intro
Asp.Net MVC Intro
 
Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6
 
ASP.NET MVC Performance
ASP.NET MVC PerformanceASP.NET MVC Performance
ASP.NET MVC Performance
 
Model View Controller (MVC)
Model View Controller (MVC)Model View Controller (MVC)
Model View Controller (MVC)
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 

Similar to Getting Started with ASP.NET MVC

Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To Mvc
Volkan Uzun
 
MSDN - ASP.NET MVC
MSDN - ASP.NET MVCMSDN - ASP.NET MVC
MSDN - ASP.NET MVC
Maarten Balliauw
 
Php and-mvc
Php and-mvcPhp and-mvc
Php and-mvc
Manoj Sahoo
 
Which is better asp.net mvc vs asp.net
Which is better  asp.net mvc vs asp.netWhich is better  asp.net mvc vs asp.net
Which is better asp.net mvc vs asp.net
Concetto Labs
 
Object Oriented Programming with Laravel - Session 3
Object Oriented Programming with Laravel - Session 3Object Oriented Programming with Laravel - Session 3
Object Oriented Programming with Laravel - Session 3
Shahrzad Peyman
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
ivpol
 
Pcs global (4)
Pcs global (4)Pcs global (4)
Pcs global (4)
Suraj Soni
 
ASP.NET MVC 3
ASP.NET MVC 3ASP.NET MVC 3
ASP.NET MVC 3
joselinoneto
 
TDD with ASP.NET MVC 1.0
TDD with ASP.NET MVC 1.0TDD with ASP.NET MVC 1.0
TDD with ASP.NET MVC 1.0
Shiju Varghese
 
MVC
MVCMVC
MVC
akshin
 
MVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - IndiandotnetMVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - Indiandotnet
Indiandotnet
 
ASP.net MVC CodeCamp Presentation
ASP.net MVC CodeCamp PresentationASP.net MVC CodeCamp Presentation
ASP.net MVC CodeCamp Presentation
buildmaster
 
Day1
Day1Day1
Worry free web development
Worry free web developmentWorry free web development
Worry free web development
Estelle Weyl
 
MongoDB.local Dallas 2019: MongoDB Stitch Tutorial
MongoDB.local Dallas 2019: MongoDB Stitch TutorialMongoDB.local Dallas 2019: MongoDB Stitch Tutorial
MongoDB.local Dallas 2019: MongoDB Stitch Tutorial
MongoDB
 
ASP.NET MVC introduction
ASP.NET MVC introductionASP.NET MVC introduction
ASP.NET MVC introduction
Tomi Juhola
 
MVC Demystified: Essence of Ruby on Rails
MVC Demystified: Essence of Ruby on RailsMVC Demystified: Essence of Ruby on Rails
MVC Demystified: Essence of Ruby on Rails
codeinmotion
 
report_vendor_connect
report_vendor_connectreport_vendor_connect
report_vendor_connect
Yash Mittal
 
ASP.NET MVC 5 Building Your First Web Application (A Beginner S Guide
ASP.NET MVC 5  Building Your First Web Application (A Beginner S GuideASP.NET MVC 5  Building Your First Web Application (A Beginner S Guide
ASP.NET MVC 5 Building Your First Web Application (A Beginner S Guide
Alicia Buske
 
Welcome to IE8 - Integrating Your Site With Internet Explorer 8
Welcome to IE8 - Integrating Your Site With Internet Explorer 8Welcome to IE8 - Integrating Your Site With Internet Explorer 8
Welcome to IE8 - Integrating Your Site With Internet Explorer 8
Lachlan Hardy
 

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

Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To Mvc
 
MSDN - ASP.NET MVC
MSDN - ASP.NET MVCMSDN - ASP.NET MVC
MSDN - ASP.NET MVC
 
Php and-mvc
Php and-mvcPhp and-mvc
Php and-mvc
 
Which is better asp.net mvc vs asp.net
Which is better  asp.net mvc vs asp.netWhich is better  asp.net mvc vs asp.net
Which is better asp.net mvc vs asp.net
 
Object Oriented Programming with Laravel - Session 3
Object Oriented Programming with Laravel - Session 3Object Oriented Programming with Laravel - Session 3
Object Oriented Programming with Laravel - Session 3
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
Pcs global (4)
Pcs global (4)Pcs global (4)
Pcs global (4)
 
ASP.NET MVC 3
ASP.NET MVC 3ASP.NET MVC 3
ASP.NET MVC 3
 
TDD with ASP.NET MVC 1.0
TDD with ASP.NET MVC 1.0TDD with ASP.NET MVC 1.0
TDD with ASP.NET MVC 1.0
 
MVC
MVCMVC
MVC
 
MVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - IndiandotnetMVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - Indiandotnet
 
ASP.net MVC CodeCamp Presentation
ASP.net MVC CodeCamp PresentationASP.net MVC CodeCamp Presentation
ASP.net MVC CodeCamp Presentation
 
Day1
Day1Day1
Day1
 
Worry free web development
Worry free web developmentWorry free web development
Worry free web development
 
MongoDB.local Dallas 2019: MongoDB Stitch Tutorial
MongoDB.local Dallas 2019: MongoDB Stitch TutorialMongoDB.local Dallas 2019: MongoDB Stitch Tutorial
MongoDB.local Dallas 2019: MongoDB Stitch Tutorial
 
ASP.NET MVC introduction
ASP.NET MVC introductionASP.NET MVC introduction
ASP.NET MVC introduction
 
MVC Demystified: Essence of Ruby on Rails
MVC Demystified: Essence of Ruby on RailsMVC Demystified: Essence of Ruby on Rails
MVC Demystified: Essence of Ruby on Rails
 
report_vendor_connect
report_vendor_connectreport_vendor_connect
report_vendor_connect
 
ASP.NET MVC 5 Building Your First Web Application (A Beginner S Guide
ASP.NET MVC 5  Building Your First Web Application (A Beginner S GuideASP.NET MVC 5  Building Your First Web Application (A Beginner S Guide
ASP.NET MVC 5 Building Your First Web Application (A Beginner S Guide
 
Welcome to IE8 - Integrating Your Site With Internet Explorer 8
Welcome to IE8 - Integrating Your Site With Internet Explorer 8Welcome to IE8 - Integrating Your Site With Internet Explorer 8
Welcome to IE8 - Integrating Your Site With Internet Explorer 8
 

Recently uploaded

Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Zilliz
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
TIPNGVN2
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 

Recently uploaded (20)

Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 

Getting Started with ASP.NET MVC

  • 1. Getting Started with ASP.NET MVC
  • 2. Housekeeping Stuttering 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/
  • 3. HattanShobokshi Senior Software Engineer www.hattanshobokshi.com hattan@gmail.com http://speakerrate.com/hattan Who am I?
  • 4. Goals for this talk Present an overview of ASP.NET MVC MVC vsWebforms. Why? What is the MVC paradigm? Controllers and Action Methods Views Html Helpers Models Model Binding Routing Best 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 MVC Current Version is MVC3. MVC2 and MVC3 are extension of MVC1. MVC1 and MVC2 - .NET Framework 3.5 & 4.0 MVC3 4.0 ONLY Visual Studio Tooling Support Convention over configuration What is ASP.NET MVC
  • 7.
  • 8. Why should I use ASP.NET MVC? Testability Model Binder is awesome! No Viewstate SEO friendly url’s Complete control over Html output Easier integration with Jquery Better Separation of Concerns
  • 9. ASP.NET Web Forms Traditional urlhttp://www.yoursite.com/admin/menu.aspx
  • 10. ASP.NET MVC http://www.yoursite.com/admin/menu Admin is not a folder, but a class called AdminController Menu is not a file, but a Method in the AdminController Class
  • 11. DEMO
  • 12. Routing Route engine parses url’s, extracts any data and sends it off to controller Create extremely customizable routes Route table defines routes in global.asax You 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. Views No Code behind Action 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 Helpers Html 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 Binding Takes data from an html form and creates an object. No need to write plumbing code
  • 17. Best Practices Never 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 helper Add namespace to web.config so you don’t have to keep referencing it on each page The 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. Resources http://www.asp.net/learn/mvc/ http://www.asp.net/learn/mvc-videos/ Pro ASP.NET MVC Framework by Steven Sanderson Asp.net mvc Forumshttp://forums.asp.net/1146.aspx http://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 Methods Views Html Helpers Models Model Binding Routing Best Practices

Editor's Notes

  1. 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