MVC3 Development with visual studio 2010
Upcoming SlideShare
Loading in...5
×
 

MVC3 Development with visual studio 2010

on

  • 4,906 views

 

Statistics

Views

Total Views
4,906
Views on SlideShare
4,897
Embed Views
9

Actions

Likes
0
Downloads
93
Comments
0

2 Embeds 9

http://blog.abhishekluv.in 6
http://www.abhishekluv.in 3

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • I have a demo for adding new views to this dialog.
  • I have a demo for adding new views to this dialog.
  • ASP.NET MVC 3 supports global action filters. Global action filters are applied to all actions in web application. For example, you can use global action filters for common security checks. They are registered in the global.asax file of the application. Therefore, you can run a filter for all controllers or controller actions, without adding the attribute to all of them. Additionally, you can run a filter only if certain conditions apply.

MVC3 Development with visual studio 2010 MVC3 Development with visual studio 2010 Presentation Transcript

  • MVC3 Development with Visual Studio 2010
    Harish Ranganathan @ranganh
    Senior Developer Evangelist
    Microsoft Corporation, India
  • A quick round trip
    MVC v 1.0 released in 2009
    MVC 2 released in 2010
    MVC 3 released in Jan 2011
    MVC 3 Tools update in April 2011
  • What’s new in ASP.NET MVC 3
    Razor View Engine
    Multiple View Engine Support
    Validation Improvements
    Dynamic ViewBag
    Global Filters
    New ActionResults
    Project Dialog Improvements
    VBHTML Support
    Task-based Helpers
    Improved Dependency Injection
    Porting MVC Script Libraries to jQuery
    Granular ValidateInput
    Add View Dialog Improvements
    Project Dialog Extensibility Improvements
    Improved Caching Support
    JSON Binding Support
  • What’s new in ASP.NET MVC 3
    Razor View Engine
    Multiple View Engine Support
    Validation Improvements
    Dynamic ViewBag
    Global Filters
    New ActionResults
    Project Dialog Improvements
    VBHTML Support
    Task-based Helpers
    Improved Dependency Injection
    Porting MVC Script Libraries to jQuery
    Granular ValidateInput
    Add View Dialog Improvements
    Project Dialog Extensibility Improvements
    Improved Caching Support
    JSON Binding Support
  • Upgrading
    ASP.NET MVC 3 Application Upgrader
    tinyurl.com/upgrademvc3
  • demo
    Quick overview of MVC3 and Razor
  • Multiple View Engine Support
  • Multiple View Engine Support
    protected void Application_Start()
    {
    ViewEngines.Engines.Add(newSparkViewFactory());

    }
  • Razor
    Clean & Concise
    Based on Existing Languages
    Intellisense
    Code Colorization
    Unit Testing Support
  • Syntax Comparison
    Web Forms
    6 transitions
    <ul>
    <% for (int i = 0; i < 10; i++) {%>
    <li><%=i %></li>
    <%} %>
    </ul>
    <ul>
    @for (int i = 0; i < 10; i++)
    {
    <li>@i</li>
    }
    </ul>
    Razor
    2 transitions
  • Layouts
    View
    Layout
    <html>
    <head>
    <title>Title<title>
    </head>
    <body>
    @RenderSection("Menu")
    @RenderBody()
    </body>
    </html>
    @{
    Layout="~/Views/Shared/_Layout.cshtml";
    }
    @section Menu {
    <ul id="pageMenu">
    <li>Item 1</li>
    <li>Item 2</li>
    </ul>
    }
  • Web Forms to Razor
    Open Source Razor Converter
    github.com/telerik/razor-converter
  • demo
    Razor Views
  • Global Filters
    No longer need attributes
    Applies to all actions on all controllers
  • Global Filters
    protected void Application_Start()
    {
    GlobalFilters.Filters.Add(new MyActionFilterAttribute());

    }
  • demo
    Global Action Filters
  • Dynamic ViewBag
    Accessible via properties
    Properties map to ViewData entries
    Late-bound
  • Dynamic ViewBag
    <head>
    <title>@ViewBag.Title<title>
    </head>
  • demo
    Dynamic ViewBag
  • JavaScript and AJAX
    JSON Binding
    jQuery Validation
    Unobstrusive JavaScript
    Separation of Presentation and Content
    No errors if AJAX isn’t supported
    RemoteAttribute
  • Client Validation
    web.config
    <configuration>
    <appSettings>
    <add key=“ClientValidationEnabled" value="true"/> </appSettings>
    </configuration>
    code
    HtmlHelper.ClientValidationEnabled = true;
  • demo
    Validations
  • Resources
    ASP.NET MVC 3
    http://www.asp.net/mvc/mvc3
    Scott Gu’s Blog
    http://weblogs.asp.net/scottgu
    Phil Haack’s Blog
    http://haacked.com/
  • Contacts
    Blog
    http://geekswithblogs.net/ranganh
    Twitter
    @ranganh
  • © 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.