SlideShare a Scribd company logo
1 of 25
rev 1.0/0111 Getting Started withASP.NET MVC 3 and Razor Dan Wahlin http://www.TheWahlinGroup.com
Contact Info Blog http://weblogs.asp.net/dwahlin Twitter @DanWahlin Email: dwahlin@theWahlinGroup.com
rev 1.0/0111 Agenda The MVC Pattern ASP.NET MVC 3 Getting Started with Razor Demos
NO!
MVC Pattern - A Conceptual View Decouples the backend business logic from the  front end Model Binds the model and view together and selects which view to display next Data Transfer Request Controller Business InteractionLayer User InteractionLayer View Response Visualizes the application data supplied by the model
Model Has business/domain logic ASP.NET MVC doesn’t tell you what to use: LINQ to SQL nHiberate Entity Framework PLINQO Custom/POCO object rev 1.0/0111
View Should be “thin” and dumb No business logic Only Display logic / Transformation of data JavaScript is valid for client side - jQuery rev 1.0/0111
Controller Should also be "thin" Controller has "Actions" Requests always come through the controller Decides what data is needed Tells which View to render Tells the View what "Model" render rev 1.0/0111
rev 1.0/0111 Agenda The MVC Pattern ASP.NET MVC 3 Getting Started with Razor Demos
What is ASP.NET MVC? ASP.NET MVC implements the Model-View-Controller pattern Provides an alternative to ASP.NET Web Forms Available from http://www.asp.net/mvc/mvc3 rev 1.0/0111 INTRODUCTION-10
Goals of ASP.NET MVC Framework rev 1.0/0111 ,[object Object]
Support existing ASP.NET runtime features
100% control over rendered HTML
Testable by default (built with TDD in mind)
Support third-party view engines
Support static and dynamic languages
Auto-mapping of form variables to object properties
Built-in validation support,[object Object]
ASP.NET MVC 3 Project Structure INTRODUCTION-13 Controllers Razor Pages (Views) Model Classes "Master Page" rev 1.0/0111
Steps to use ASP.NET MVC Create a controller class in the Controllers folder Add one or more Actions (methods) into the controller Right-click on an Action and select Add View from the menu rev 1.0/0111
rev 1.0/0111 Agenda The MVC Pattern ASP.NET MVC 3 Getting Started with Razor Demos
What is Razor? ASP.NET MVC 3 ships with a new View Engine called "Razor" Less markup transitions as compared to the ASP.NET Web Forms View Engine Provides a compact way to mingle code with markup Uses the @ character rev 1.0/0111
Without Razor <ul> <%foreach (varcust in Customers) { %> 	     <li><%: cust.Name%></li> <% } %> </ul> rev 1.0/0111
With Razor <ul> 	@foreach (varcust in Customers) {	     <li>@cust.Name</li> 	}  </ul> rev 1.0/0111
Razor Fundamentals Razor provides a compact syntax for mixing "code" with markup: rev 1.0/0111

More Related Content

What's hot

Head first asp.net mvc 2.0 rtt
Head first asp.net mvc 2.0 rttHead first asp.net mvc 2.0 rtt
Head first asp.net mvc 2.0 rttLanvige Jiang
 
What's new in asp.net mvc 4
What's new in asp.net mvc 4What's new in asp.net mvc 4
What's new in asp.net mvc 4Simone Chiaretta
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentationivpol
 
Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To MvcVolkan Uzun
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentationBhavin Shah
 
Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Thomas Robbins
 
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 - IndiandotnetIndiandotnet
 
Advanced MVC3
Advanced MVC3Advanced MVC3
Advanced MVC3shobokshi
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVCKhaled Musaied
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVCLearnNowOnline
 
Model View Controller
Model View ControllerModel View Controller
Model View Controllerurs_tush
 
ASP .NET MVC
ASP .NET MVC ASP .NET MVC
ASP .NET MVC eldorina
 
Tightly coupled view (model bounded view)
Tightly coupled view (model bounded view)Tightly coupled view (model bounded view)
Tightly coupled view (model bounded view)IT PROGRAMMING WORLD
 
Future ASP.NET features for UID / HTML developers
Future ASP.NET features for UID / HTML developersFuture ASP.NET features for UID / HTML developers
Future ASP.NET features for UID / HTML developersMark Everard
 
ASP.NET MVC 5 - EF 6 - VS2015
ASP.NET MVC 5 - EF 6 - VS2015ASP.NET MVC 5 - EF 6 - VS2015
ASP.NET MVC 5 - EF 6 - VS2015Hossein Zahed
 
Asp.net mvc presentation by Nitin Sawant
Asp.net mvc presentation by Nitin SawantAsp.net mvc presentation by Nitin Sawant
Asp.net mvc presentation by Nitin SawantNitin Sawant
 
Building a MVC eCommerce Site in Under 5 Minutes
Building a MVC eCommerce Site in Under 5 MinutesBuilding a MVC eCommerce Site in Under 5 Minutes
Building a MVC eCommerce Site in Under 5 MinutesGaines Kergosien
 
Developing great applications using ASP.NET MVC and ASP.NET AJAX
Developing great applications using ASP.NET MVC and ASP.NET AJAXDeveloping great applications using ASP.NET MVC and ASP.NET AJAX
Developing great applications using ASP.NET MVC and ASP.NET AJAXTatham Oddie
 
Introduction To ASP.Net MVC
Introduction To ASP.Net MVCIntroduction To ASP.Net MVC
Introduction To ASP.Net MVCJoe Wilson
 

What's hot (20)

Head first asp.net mvc 2.0 rtt
Head first asp.net mvc 2.0 rttHead first asp.net mvc 2.0 rtt
Head first asp.net mvc 2.0 rtt
 
What's new in asp.net mvc 4
What's new in asp.net mvc 4What's new in asp.net mvc 4
What's new in asp.net mvc 4
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To Mvc
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentation
 
Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013
 
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
 
Advanced MVC3
Advanced MVC3Advanced MVC3
Advanced MVC3
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
Model View Controller
Model View ControllerModel View Controller
Model View Controller
 
ASP .NET MVC
ASP .NET MVC ASP .NET MVC
ASP .NET MVC
 
Tightly coupled view (model bounded view)
Tightly coupled view (model bounded view)Tightly coupled view (model bounded view)
Tightly coupled view (model bounded view)
 
Future ASP.NET features for UID / HTML developers
Future ASP.NET features for UID / HTML developersFuture ASP.NET features for UID / HTML developers
Future ASP.NET features for UID / HTML developers
 
ASP.NET MVC 5 - EF 6 - VS2015
ASP.NET MVC 5 - EF 6 - VS2015ASP.NET MVC 5 - EF 6 - VS2015
ASP.NET MVC 5 - EF 6 - VS2015
 
Asp.net mvc presentation by Nitin Sawant
Asp.net mvc presentation by Nitin SawantAsp.net mvc presentation by Nitin Sawant
Asp.net mvc presentation by Nitin Sawant
 
Building a MVC eCommerce Site in Under 5 Minutes
Building a MVC eCommerce Site in Under 5 MinutesBuilding a MVC eCommerce Site in Under 5 Minutes
Building a MVC eCommerce Site in Under 5 Minutes
 
Developing great applications using ASP.NET MVC and ASP.NET AJAX
Developing great applications using ASP.NET MVC and ASP.NET AJAXDeveloping great applications using ASP.NET MVC and ASP.NET AJAX
Developing great applications using ASP.NET MVC and ASP.NET AJAX
 
Introduction To ASP.Net MVC
Introduction To ASP.Net MVCIntroduction To ASP.Net MVC
Introduction To ASP.Net MVC
 

Viewers also liked

mach3
mach3mach3
mach3leo
 
Development Trends - What's New in the World of Web Development
Development Trends - What's New in the World of Web DevelopmentDevelopment Trends - What's New in the World of Web Development
Development Trends - What's New in the World of Web DevelopmentDan Wahlin
 
Integrating Security Roles into Microsoft Silverlight Applications
Integrating Security Roles into Microsoft Silverlight ApplicationsIntegrating Security Roles into Microsoft Silverlight Applications
Integrating Security Roles into Microsoft Silverlight ApplicationsDan Wahlin
 
Building an End-to-End AngularJS Application
Building an End-to-End AngularJS ApplicationBuilding an End-to-End AngularJS Application
Building an End-to-End AngularJS ApplicationDan Wahlin
 
Building AngularJS Custom Directives
Building AngularJS Custom DirectivesBuilding AngularJS Custom Directives
Building AngularJS Custom DirectivesDan Wahlin
 
Lastest Trends in Web Development
Lastest Trends in Web DevelopmentLastest Trends in Web Development
Lastest Trends in Web DevelopmentDoris Chen
 
Introduction to ASP.Net Mvc3 with Razor
Introduction to ASP.Net Mvc3 with RazorIntroduction to ASP.Net Mvc3 with Razor
Introduction to ASP.Net Mvc3 with RazorManoj Kumar
 
ASP.NET MVC Tips, Tricks and Hidden Gems
ASP.NET MVC Tips, Tricks and Hidden GemsASP.NET MVC Tips, Tricks and Hidden Gems
ASP.NET MVC Tips, Tricks and Hidden GemsShay Friedman
 
JavaScript Patterns to Cleanup your Code
JavaScript Patterns to Cleanup your CodeJavaScript Patterns to Cleanup your Code
JavaScript Patterns to Cleanup your CodeDan Wahlin
 
Using jQuery Templates
Using jQuery TemplatesUsing jQuery Templates
Using jQuery TemplatesDan Wahlin
 
AngularJS in 60ish Minutes
AngularJS in 60ish MinutesAngularJS in 60ish Minutes
AngularJS in 60ish MinutesDan Wahlin
 
The Big Comparison of ASP.NET MVC View Engines
The Big Comparison of ASP.NET MVC View EnginesThe Big Comparison of ASP.NET MVC View Engines
The Big Comparison of ASP.NET MVC View EnginesShay Friedman
 
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Dan Wahlin
 
Basics of angular directive (Part - 1)
Basics of angular directive (Part - 1)Basics of angular directive (Part - 1)
Basics of angular directive (Part - 1)Vijay Kani
 
AngularJS Custom Directives
AngularJS Custom DirectivesAngularJS Custom Directives
AngularJS Custom Directivesyprodev
 
Custom AngularJS Directives
Custom AngularJS DirectivesCustom AngularJS Directives
Custom AngularJS Directivesyprodev
 
New microsoft office power point presentation
New microsoft office power point presentationNew microsoft office power point presentation
New microsoft office power point presentationDiyAshraF
 

Viewers also liked (20)

mach3
mach3mach3
mach3
 
Development Trends - What's New in the World of Web Development
Development Trends - What's New in the World of Web DevelopmentDevelopment Trends - What's New in the World of Web Development
Development Trends - What's New in the World of Web Development
 
Integrating Security Roles into Microsoft Silverlight Applications
Integrating Security Roles into Microsoft Silverlight ApplicationsIntegrating Security Roles into Microsoft Silverlight Applications
Integrating Security Roles into Microsoft Silverlight Applications
 
Building an End-to-End AngularJS Application
Building an End-to-End AngularJS ApplicationBuilding an End-to-End AngularJS Application
Building an End-to-End AngularJS Application
 
Building AngularJS Custom Directives
Building AngularJS Custom DirectivesBuilding AngularJS Custom Directives
Building AngularJS Custom Directives
 
Top 13 Web Development Trends And Predictions For 2015
Top 13 Web Development Trends And Predictions For 2015Top 13 Web Development Trends And Predictions For 2015
Top 13 Web Development Trends And Predictions For 2015
 
Lastest Trends in Web Development
Lastest Trends in Web DevelopmentLastest Trends in Web Development
Lastest Trends in Web Development
 
Introduction to ASP.Net Mvc3 with Razor
Introduction to ASP.Net Mvc3 with RazorIntroduction to ASP.Net Mvc3 with Razor
Introduction to ASP.Net Mvc3 with Razor
 
ASP.NET MVC Tips, Tricks and Hidden Gems
ASP.NET MVC Tips, Tricks and Hidden GemsASP.NET MVC Tips, Tricks and Hidden Gems
ASP.NET MVC Tips, Tricks and Hidden Gems
 
JavaScript Patterns to Cleanup your Code
JavaScript Patterns to Cleanup your CodeJavaScript Patterns to Cleanup your Code
JavaScript Patterns to Cleanup your Code
 
Using jQuery Templates
Using jQuery TemplatesUsing jQuery Templates
Using jQuery Templates
 
AngularJS in 60ish Minutes
AngularJS in 60ish MinutesAngularJS in 60ish Minutes
AngularJS in 60ish Minutes
 
The Big Comparison of ASP.NET MVC View Engines
The Big Comparison of ASP.NET MVC View EnginesThe Big Comparison of ASP.NET MVC View Engines
The Big Comparison of ASP.NET MVC View Engines
 
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
 
jQuery in 10 minuten
jQuery in 10 minutenjQuery in 10 minuten
jQuery in 10 minuten
 
Basics of angular directive (Part - 1)
Basics of angular directive (Part - 1)Basics of angular directive (Part - 1)
Basics of angular directive (Part - 1)
 
AngularJS Custom Directives
AngularJS Custom DirectivesAngularJS Custom Directives
AngularJS Custom Directives
 
Custom AngularJS Directives
Custom AngularJS DirectivesCustom AngularJS Directives
Custom AngularJS Directives
 
New microsoft office power point presentation
New microsoft office power point presentationNew microsoft office power point presentation
New microsoft office power point presentation
 
Actividad estadistica
Actividad estadisticaActividad estadistica
Actividad estadistica
 

Similar to Getting Started with ASP.NET MVC 3 and Razor

Introduction to mvc architecture
Introduction to mvc architectureIntroduction to mvc architecture
Introduction to mvc architectureravindraquicsolv
 
Technoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development servicesTechnoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development servicesAaron Jacobson
 
MVC First Basic
MVC First BasicMVC First Basic
MVC First BasicShyam Sir
 
Simple mvc4 prepared by gigin krishnan
Simple mvc4 prepared by gigin krishnanSimple mvc4 prepared by gigin krishnan
Simple mvc4 prepared by gigin krishnanGigin Krishnan
 
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.netConcetto Labs
 
ASP.NET MVC introduction
ASP.NET MVC introductionASP.NET MVC introduction
ASP.NET MVC introductionTomi Juhola
 
CTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCCTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCBarry Gervin
 
ASP.NET MVC Fundamental
ASP.NET MVC FundamentalASP.NET MVC Fundamental
ASP.NET MVC Fundamentalldcphuc
 
Build your website with angularjs and web apis
Build your website with angularjs and web apisBuild your website with angularjs and web apis
Build your website with angularjs and web apisChalermpon Areepong
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC PresentationVolkan Uzun
 
Introducing the ASP.NET MVC 3
Introducing the ASP.NET MVC 3Introducing the ASP.NET MVC 3
Introducing the ASP.NET MVC 3ldcphuc
 

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

Introduction to mvc architecture
Introduction to mvc architectureIntroduction to mvc architecture
Introduction to mvc architecture
 
Technoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development servicesTechnoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development services
 
MVC First Basic
MVC First BasicMVC First Basic
MVC First Basic
 
Asp.Net MVC Intro
Asp.Net MVC IntroAsp.Net MVC Intro
Asp.Net MVC Intro
 
Asp.netmvc handson
Asp.netmvc handsonAsp.netmvc handson
Asp.netmvc handson
 
Mvc
MvcMvc
Mvc
 
Simple mvc4 prepared by gigin krishnan
Simple mvc4 prepared by gigin krishnanSimple mvc4 prepared by gigin krishnan
Simple mvc4 prepared by gigin krishnan
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net 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
 
ASP.NET MVC 3
ASP.NET MVC 3ASP.NET MVC 3
ASP.NET MVC 3
 
ASP.NET MVC introduction
ASP.NET MVC introductionASP.NET MVC introduction
ASP.NET MVC introduction
 
MVC 4
MVC 4MVC 4
MVC 4
 
MVC
MVCMVC
MVC
 
Mvc
MvcMvc
Mvc
 
CTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCCTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVC
 
ASP.NET MVC Fundamental
ASP.NET MVC FundamentalASP.NET MVC Fundamental
ASP.NET MVC Fundamental
 
Build your website with angularjs and web apis
Build your website with angularjs and web apisBuild your website with angularjs and web apis
Build your website with angularjs and web apis
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
Asp.net,mvc
Asp.net,mvcAsp.net,mvc
Asp.net,mvc
 
Introducing the ASP.NET MVC 3
Introducing the ASP.NET MVC 3Introducing the ASP.NET MVC 3
Introducing the ASP.NET MVC 3
 

Recently uploaded

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 

Recently uploaded (20)

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 

Getting Started with ASP.NET MVC 3 and Razor

  • 1. rev 1.0/0111 Getting Started withASP.NET MVC 3 and Razor Dan Wahlin http://www.TheWahlinGroup.com
  • 2. Contact Info Blog http://weblogs.asp.net/dwahlin Twitter @DanWahlin Email: dwahlin@theWahlinGroup.com
  • 3. rev 1.0/0111 Agenda The MVC Pattern ASP.NET MVC 3 Getting Started with Razor Demos
  • 4. NO!
  • 5. MVC Pattern - A Conceptual View Decouples the backend business logic from the front end Model Binds the model and view together and selects which view to display next Data Transfer Request Controller Business InteractionLayer User InteractionLayer View Response Visualizes the application data supplied by the model
  • 6. Model Has business/domain logic ASP.NET MVC doesn’t tell you what to use: LINQ to SQL nHiberate Entity Framework PLINQO Custom/POCO object rev 1.0/0111
  • 7. View Should be “thin” and dumb No business logic Only Display logic / Transformation of data JavaScript is valid for client side - jQuery rev 1.0/0111
  • 8. Controller Should also be "thin" Controller has "Actions" Requests always come through the controller Decides what data is needed Tells which View to render Tells the View what "Model" render rev 1.0/0111
  • 9. rev 1.0/0111 Agenda The MVC Pattern ASP.NET MVC 3 Getting Started with Razor Demos
  • 10. What is ASP.NET MVC? ASP.NET MVC implements the Model-View-Controller pattern Provides an alternative to ASP.NET Web Forms Available from http://www.asp.net/mvc/mvc3 rev 1.0/0111 INTRODUCTION-10
  • 11.
  • 12. Support existing ASP.NET runtime features
  • 13. 100% control over rendered HTML
  • 14. Testable by default (built with TDD in mind)
  • 16. Support static and dynamic languages
  • 17. Auto-mapping of form variables to object properties
  • 18.
  • 19. ASP.NET MVC 3 Project Structure INTRODUCTION-13 Controllers Razor Pages (Views) Model Classes "Master Page" rev 1.0/0111
  • 20. Steps to use ASP.NET MVC Create a controller class in the Controllers folder Add one or more Actions (methods) into the controller Right-click on an Action and select Add View from the menu rev 1.0/0111
  • 21. rev 1.0/0111 Agenda The MVC Pattern ASP.NET MVC 3 Getting Started with Razor Demos
  • 22. What is Razor? ASP.NET MVC 3 ships with a new View Engine called "Razor" Less markup transitions as compared to the ASP.NET Web Forms View Engine Provides a compact way to mingle code with markup Uses the @ character rev 1.0/0111
  • 23. Without Razor <ul> <%foreach (varcust in Customers) { %> <li><%: cust.Name%></li> <% } %> </ul> rev 1.0/0111
  • 24. With Razor <ul> @foreach (varcust in Customers) { <li>@cust.Name</li> } </ul> rev 1.0/0111
  • 25. Razor Fundamentals Razor provides a compact syntax for mixing "code" with markup: rev 1.0/0111
  • 26. Razor Example @model ProjectName.ViewModels.CustomerViewModel <fieldset> <legend>Customer Data</legend> <p> <label for="FirstName">First Name:</label> @Html.EditorFor(m => m.Customer.FirstName) @Html.ValidationMessageFor(m => m.Customer.FirstName, "*") </p> <p> <label for="LastName">Last Name:</label> @Html.EditorFor(m => m.Customer.LastName) @Html.ValidationMessageFor(m => m.Customer.LastName, "*") </p> </fieldset> rev 1.0/0111
  • 27. Razor Layout Pages Razor uses a _Layout.cshtml file as a "master page" _Layout.cshtml <html> <title>@ViewBag.Title</title> <body> @RenderBody() </body> </html> Index.cshtml@{ ViewBag.Title= “Your Page Title”; } <div>Hello World!</div>
  • 28. rev 1.0/0111 Agenda The MVC Pattern ASP.NET MVC 3 Getting Started with Razor Demos
  • 29. Thanks! Blog http://weblogs.asp.net/dwahlin Twitter @DanWahlin Email: dwahlin@theWahlinGroup.com
  • 30. ASP.NET MVC 3 Demo Site Download an ASP.NET MVC 3 demo site from http://mvcmusicstore.codeplex.com rev 1.0/0111
  • 31. Razor Tools Web Forms View to Razor View Converter:https://github.com/telerik/razor-converter MVC 2 to MVC 3 Project Converterhttp://aspnet.codeplex.com/releases/view/59008 rev 1.0/0111

Editor's Notes

  1. There have been a lot of rumors floating around that ASP.NET Web Forms is dying and being replaced with ASP.NET MVC…you know, like the Web Forms Reaper is coming? Well….here I am!
  2. It is up to you to decide how you want to get your data and how to define your objects. Although there are accepted guidelines on how to have good design, it is not decided for you with The ASP.Net MVC Framework.