1 / 25

WEB309 What’s new in ASP.NET MVC 3

WEB309 What’s new in ASP.NET MVC 3. Jonathan Carter Microsoft Corporation joncart@microsoft.com www.lostintangent.com @lostintangent. Disclaimer. This talk requires a really good understanding of ASP.NET MVC 1 & 2. Agenda. The title of the talk says it all…. What’s new in ASP.NET MVC 3?.

eros
Download Presentation

WEB309 What’s new in ASP.NET MVC 3

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. WEB309What’s new in ASP.NET MVC 3 Jonathan Carter Microsoft Corporation joncart@microsoft.com www.lostintangent.com @lostintangent

  2. Disclaimer This talk requires a really good understanding of ASP.NET MVC 1 & 2

  3. Agenda The title of the talk says it all…

  4. What’s new in ASP.NET MVC 3?

  5. Let’s talk about the four key additions…

  6. Package management • “Simplified” view development • Improved testability • Global filters

  7. How do you add a feature to an ASP.NET application?

  8. Find it on the web • Download the bits • Add any assembly references • Add any other code files • Modify the web.config if neccesary • Repeat 1-5 for dependencies • Scream!

  9. There has to be a better way…

  10. Demo NUGET

  11. View Development: Favoring essence over ceremony…

  12. View Template Options <ul> <%for (int i = 0; i < 10; i++) { %> <li><%=i%></li> <%}%> </ul> Web Forms (6 transitions): <ul> @for (int i = 0; i < 10; i++) { <li>@i</li> } </ul> Razor (2 transitions):

  13. Code <-> Markup @{ var name = “John Doe”; <div> Your name: @name </div> } Option 1: HTML Block @{ var name = “John Doe”; <text> Your name: @name </text> } Option 2: Text Block @{ var name = “John Doe”; } @: Your name: @name Option 3: Single line of output in markup

  14. Layouts /Shared/_Layout.cshtml • <html> •     <head> •       <title>Simple Layout</title> •     </head> •     <body>  • @RenderBody() • </body> • </html> MyPage.cshtml • @{ • Layout = "/Shared/_Layout.cshtml"; • } • <p> • My content goes here • </p>

  15. Sections /Shared/_Layout.cshtml MyPage.cshtml • <html> •     <head> •       <title>Simple Layout</title> •     </head> •     <body>  • @RenderSection("Menu") •         @RenderBody() • </body> • </html> • @{ • Layout = "/Shared/_Layout.cshtml"; • } • @section Menu { • <ulid="pageMenu"> • <li>Option 1</li> • <li>Option 2</li> • </ul> • } • <p> • My content goes here • </p>

  16. What is the component story?

  17. Helpersof course! • “Controls” (e.g. WebGrid) • Facebook • Twitter • PayPal • UserVoice • OData • Windows Azure Storage • Etc.

  18. Demo Razor

  19. Have you had issues with decoupling your app from dependencies?

  20. Pick your favorite DI container • Register your dependencies • Register it with MVC • Write awesomely decoupled code

  21. Demo Dependency RESOLUTION

  22. Demo Global filters

  23. Session Evaluations Tell us what you think, and you could win! All evaluations submitted are automatically entered into a daily prize draw*  Sign-in to the Schedule Builder at http://europe.msteched.com/topic/list/ * Details of prize draw rules can be obtained from the Information Desk.

  24. © 2010 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.

More Related