MSDN - ASP.NET MVC

Maarten Balliauw
Maarten BalliauwDeveloper Advocate
ASP.NET MVC (model-view-controller) Maarten Balliauw – RealDolmen http://blog.maartenballiauw.be
Who am I? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
ASP.NET… ,[object Object],[object Object],ASP.NET Caching Modules Handlers Intrinsics Pages Controls Globalization Profile Master Pages Membership Roles Etc.
Look at it differently! ,[object Object],[object Object],Presentation Runtime ASP.NET Dynamic Data ASP.NET WebForms ASP.NET MVC ASP.NET Core
ASP.NET MVC ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Things you will lose… ,[object Object],[object Object],[object Object]
MVC? Model-View-Controller! Separation of concerns! Controller (Input) Model (Logic) View (Presentation)
What does an MVC request look like? Controller Handles input (HTTP requests) View Visually represents the model ViewData Request View Controller Response
DEMO File > New…
Framework Goals ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Clean URLs ,[object Object],[object Object],[object Object],[object Object],My Favorite
Extensibility ,[object Object],[object Object],Controller Builder Controller Factory Controller View Engine View Controller Action Invoker Action Result Action Filters Model  Binders
DEMO ,[object Object]
Testing ,[object Object],[object Object],[object Object],[object Object]
Infrastructure designed for testing ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Testing controller actions ,[object Object],[object Object],[object Object],[object Object],[TestMethod] public void ShowPostsDisplayPostView()  { BlogController controller = new BlogController(…); var result = controller.ShowPost(2) as ViewResult; Assert.IsNotNull(result); Assert.AreEqual(result.ViewData[ " Message " ],  " Hello " ); }
Testing controller actions using Moq ,[object Object],[TestMethod] public void TestInvalidCredentials() { LoginController controller = new LoginController(); var mock = new Mock<System.Web.Security.MembershipProvider>(); mock.Expect(m => m.ValidateUser(&quot;&quot;, &quot;&quot;)).Returns(false); controller.MembershipProviderInstance = mock.Object; var result = controller.Authenticate(&quot;&quot;, &quot;&quot;) as ViewResult; Assert.IsNotNull(result); Assert.AreEqual(result.ViewName, &quot;Index&quot;); Assert.AreEqual(controller.ViewData[&quot;ErrorMessage&quot;], &quot;Invalid credentials! Please verify your username and password.&quot;); }
Testing frameworks ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DEMO ,[object Object]
Choosing between Webforms and MVC ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
So what do I choose? ,[object Object],[object Object],[object Object],[object Object],[object Object]
Takeaways ,[object Object],[object Object],[object Object],[object Object]
Resources ,[object Object],[object Object],[object Object],[object Object],[object Object]
Questions and Answers ,[object Object],[object Object]
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation.  Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.  MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
1 of 26

Recommended

ASP .net MVCASP .net MVC
ASP .net MVCDivya Sharma
5.4K views26 slides
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentationivpol
23.6K views11 slides
MVC ppt presentationMVC ppt presentation
MVC ppt presentationBhavin Shah
14K views36 slides
ASP.NET Web APIASP.NET Web API
ASP.NET Web APIhabib_786
7.1K views39 slides

More Related Content

What's hot(20)

Vue.js for beginnersVue.js for beginners
Vue.js for beginners
Julio Bitencourt9.3K views
MVC ArchitectureMVC Architecture
MVC Architecture
Prem Sanil504 views
Model View Controller (MVC)Model View Controller (MVC)
Model View Controller (MVC)
Javier Antonio Humarán Peñuñuri36.3K views
Web apiWeb api
Web api
Sudhakar Sharma17.8K views
Sharing Data Between Angular ComponentsSharing Data Between Angular Components
Sharing Data Between Angular Components
Squash Apps Pvt Ltd1.1K views
Express JSExpress JS
Express JS
Alok Guha2.5K views
Spring boot jpaSpring boot jpa
Spring boot jpa
Hamid Ghorbani915 views
reactJSreactJS
reactJS
Syam Santhosh603 views
.Net Core.Net Core
.Net Core
Bertrand Le Roy10.1K views
React jsReact js
React js
Rajesh Kolla1.2K views
Model view controller (mvc)Model view controller (mvc)
Model view controller (mvc)
M Ahsan Khan786 views
React + Redux IntroductionReact + Redux Introduction
React + Redux Introduction
Nikolaus Graf25.6K views
MVC Architecture in ASP.Net By Nyros DeveloperMVC Architecture in ASP.Net By Nyros Developer
MVC Architecture in ASP.Net By Nyros Developer
Nyros Technologies4.3K views
VueJS: The Simple RevolutionVueJS: The Simple Revolution
VueJS: The Simple Revolution
Rafael Casuso Romate2.8K views
Ppt of Basic MVC StructurePpt of Basic MVC Structure
Ppt of Basic MVC Structure
Dipika Wadhvani676 views
Introduction à AngularIntroduction à Angular
Introduction à Angular
Jean-Baptiste Vigneron3.2K views
Introduction to AngularjsIntroduction to Angularjs
Introduction to Angularjs
Manish Shekhawat67.3K views

Viewers also liked

Asp.Net MVC 5Asp.Net MVC 5
Asp.Net MVC 5Emanuele Bartolesi
17.8K views30 slides
Mvc architectureMvc architecture
Mvc architectureSurbhi Panhalkar
44.4K views28 slides
Asp.net.Asp.net.
Asp.net.Naveen Sihag
31.1K views84 slides

Viewers also liked(20)

Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
Khaled Musaied13.7K views
ASP.NET MVC for BegineersASP.NET MVC for Begineers
ASP.NET MVC for Begineers
Shravan Kumar Kasagoni5.5K views
Asp.Net MVC 5Asp.Net MVC 5
Asp.Net MVC 5
Emanuele Bartolesi17.8K views
Mvc architectureMvc architecture
Mvc architecture
Surbhi Panhalkar44.4K views
Asp.net.Asp.net.
Asp.net.
Naveen Sihag31.1K views
ASP.NET MVC WisdomASP.NET MVC Wisdom
ASP.NET MVC Wisdom
Maarten Balliauw1.3K views
Mocking - Visug sessionMocking - Visug session
Mocking - Visug session
Maarten Balliauw1.3K views
PHP And Silverlight - DevDays sessionPHP And Silverlight - DevDays session
PHP And Silverlight - DevDays session
Maarten Balliauw2.5K views
PHPExcelPHPExcel
PHPExcel
Maarten Balliauw1.5K views
Intro to asp.net mvc 4 with visual studioIntro to asp.net mvc 4 with visual studio
Intro to asp.net mvc 4 with visual studio
Organisation for Economic Co-operation & Development1.1K views
ASP.NET MVC  V  2.0ASP.NET MVC  V  2.0
ASP.NET MVC V 2.0
BT Akademi 4.3K views
Tutorial  asp.netTutorial  asp.net
Tutorial asp.net
Vivek K. Singh5.6K views
05 gui 0705 gui 07
05 gui 07
Niit Care462 views
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
Maarten Balliauw2.8K views
ASP.NET MVC 3ASP.NET MVC 3
ASP.NET MVC 3
Buu Nguyen6.2K views

Similar to MSDN - ASP.NET MVC(20)

CTTDNUG ASP.NET MVCCTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVC
Barry Gervin7.2K views
Introduction To MvcIntroduction To Mvc
Introduction To Mvc
Volkan Uzun2.4K views
Introduction to mvc architectureIntroduction to mvc architecture
Introduction to mvc architecture
ravindraquicsolv1.3K views
Asp.Net MVC IntroAsp.Net MVC Intro
Asp.Net MVC Intro
Stefano Paluello7.9K views
ASP.NET MVC 3ASP.NET MVC 3
ASP.NET MVC 3
joselinoneto610 views
Asp.net mvcAsp.net mvc
Asp.net mvc
Naga Harish M1.9K views
TDD with ASP.NET MVC 1.0TDD with ASP.NET MVC 1.0
TDD with ASP.NET MVC 1.0
Shiju Varghese1.2K views
Head first asp.net mvc 2.0 rttHead first asp.net mvc 2.0 rtt
Head first asp.net mvc 2.0 rtt
Lanvige Jiang3.6K views
Introduction to ASP.NET MVC 1.0Introduction to ASP.NET MVC 1.0
Introduction to ASP.NET MVC 1.0
Shiju Varghese1.6K views
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentation
Rasel Khan2.5K views
MvcMvc
Mvc
abhigad579 views
Asp.netmvc handsonAsp.netmvc handson
Asp.netmvc handson
Prashant Kumar61 views
Mvc Brief OverviewMvc Brief Overview
Mvc Brief Overview
rainynovember121.3K views
Walther Aspnet4Walther Aspnet4
Walther Aspnet4
rsnarayanan1.9K views
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
Mayank Srivastava1.9K views
No brainerNo brainer
No brainer
Tanzim Saqib673 views

More from Maarten Balliauw(20)

Recently uploaded(20)

ThroughputThroughput
Throughput
Moisés Armani Ramírez28 views
Java Platform Approach 1.0 - Picnic MeetupJava Platform Approach 1.0 - Picnic Meetup
Java Platform Approach 1.0 - Picnic Meetup
Rick Ossendrijver23 views
The Research Portal of Catalonia: Growing more (information) & more (services)The Research Portal of Catalonia: Growing more (information) & more (services)
The Research Portal of Catalonia: Growing more (information) & more (services)
CSUC - Consorci de Serveis Universitaris de Catalunya51 views

MSDN - ASP.NET MVC

  • 1. ASP.NET MVC (model-view-controller) Maarten Balliauw – RealDolmen http://blog.maartenballiauw.be
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8. MVC? Model-View-Controller! Separation of concerns! Controller (Input) Model (Logic) View (Presentation)
  • 9. What does an MVC request look like? Controller Handles input (HTTP requests) View Visually represents the model ViewData Request View Controller Response
  • 10. DEMO File > New…
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26. © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.