Presentation is loading. Please wait.

Presentation is loading. Please wait.

Jean-Claude Trachsel Senior Consultant Trivadis AG.

Similar presentations


Presentation on theme: "Jean-Claude Trachsel Senior Consultant Trivadis AG."— Presentation transcript:

1 Jean-Claude Trachsel Senior Consultant Trivadis AG

2 Agenda Overview New Features Summary

3 ASP.NET MVC 3

4 It can be installed side-by-side with MVC 2 It requires the.NET Framework 4 Actual release is Beta

5 Global Filters Dynamic ViewModel Property New ActionResult Types Model Validation Support Ajax and jQuery Support Dependency Injection Support Razor View Engine

6 New possibility to apply a filter to all controllers Conditional filters thru IFilterProvider

7 Uses.NET 4 dynamic datatype Cleaner solution to work with the ViewModel No strings as key anymore

8 ViewData vs. ViewModel ViewData["Message"]="Welcome to ASP.NET MVC!"; ViewModel.Message="Welcome to ASP.NET MVC 3!"; @View.Message MVC 3 MVC 2

9 HttpNotFoundResult HttpRedirectResult HttpStatusCodeResult

10 HttpNotFoundResult public ActionResult About() { return HttpNotFound(); }

11 Model Validation Supports new.Net 4 DataAnnotations Features DisplayAttribute New IsValid overloads in the ValidationAttribute IValidatableObject

12 Ajax and jQuery Many new Ajax and jQuery features Visit the afternoon session ASP.NET MVC 3 specific JsonValueProviderFactory

13 Form & Fields Step 1 Edit fields on the form in the browser

14 Post Form & Fields Controller Action Controller Action Step 2 Post the form to the server. The routing engine calls the controller

15 Post Form & Fields Controller Action Controller Action Object & Property Model Binder Step 3 Instanciate the entity object and set properties to the form values

16 Form & Fields Step 1 Edit fields on the form in the browser

17 jQuery Form & Fields Step 2 Generate Json object on the client with jQuery Json

18 Ajax Post Ajax Post Form & Fields Controller Action Controller Action Step 3 Post the Json object asynchron to the server

19 Post Form & Fields Controller Action Controller Action Object & Property Jason Value Provider Jason Value Provider Step 4 Instanciate the entity object and set properties to the json values

20 Dependency Injection ASP.NET MVC 3 supports Common Service Locator library Any DI container supporting it’s IServiceLocator interface Common Service Locator library is supported by Unity Spring.NET Castle Windsor StructureMap

21 MVC 3 DI support MVC 3 beta Controllers (registering & injecting controller factories, injecting controllers) Views (registering & injecting view engines, injecting dependencies into view pages) Action Filters (locating & injecting filters) MVC 3 RC Model Binders (registering & injecting) Value Providers (registering & injecting) Validation Providers (registering & injecting) Model metadata Providers (registering & injecting)

22 View Engines ASP.NET (aspx) * Razor * Spark NHaml NDjango * Included in Visual Studio 2010

23 Compact, Expressive and Fluid Easy to learn Is not a new language Works with any Text Editor Has great Intellisense and syntax highlighting

24

25 Razor advantages 1 character instead of 5 for code blocks Razor: @ (no closing tag needed) Parser has semantic knowledge of C# / VB Aspx: Coding is fast, fluid and fun

26 «Hello World» " %> Razor Demo Razor Demo Hello World, we got Number 1: and Number 2:. @model Trivadis.Models.Product @{View.Title = "Razor Demo";} Razor Demo Hello World, we got Number 1: @Model.Number1 and Number 2: @Model.Number2. Razor aspx

27 Razor syntax Multiline statements if(){}, foreach(){} Layout/MasterPage concept _viewstart.cshtml concept

28 Summary Many helpful new features Great IoC and DI support Perfect Data Annotations support Razor, a clean, fast and fun approach

29 SwissPDC10@Trivadis Termin: 28.10.2010 Ort: Zürich - in der Trivadis Niederlassung Agenda: 16:00 h: Registrierung und Begrüssungskaffee 16:30 h: Silverlight, Azure and WP7 17:30 h: Pause mit Verpflegung 18:00 h: Keynote PDC10 mit Steve Ballmer 20:00 h: Pause mit Verpflegung 20:30 h: Podiumsdiskussion: "Was bedeuten die Ankündigung für die Praxis" 21:30 h: Verlosung der Preise

30

31 © 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.


Download ppt "Jean-Claude Trachsel Senior Consultant Trivadis AG."

Similar presentations


Ads by Google