what s new in asp net mvc 3 n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
What’s new in ASP.NET MVC 3 PowerPoint Presentation
Download Presentation
What’s new in ASP.NET MVC 3

Loading in 2 Seconds...

play fullscreen
1 / 33

What’s new in ASP.NET MVC 3 - PowerPoint PPT Presentation


  • 101 Views
  • Uploaded on

What’s new in ASP.NET MVC 3. Building a NerdDinner / AppStore Application. Introducing NerdDinner.com. Introducing NerdDinner.com. nerddinner.codeplex.com Free PDF walkthrough (updated to 2.0) tinyurl.com/ aspnetmvc. Introducing NerdDinner.com. Introducing NerdDinner.com.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'What’s new in ASP.NET MVC 3' - mendel


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
what s new in asp net mvc 3

What’s new inASP.NET MVC 3

Building a NerdDinner/AppStore Application

introducing nerddinner com1
Introducing NerdDinner.com
  • nerddinner.codeplex.com
  • Free PDF walkthrough (updated to 2.0)
    • tinyurl.com/aspnetmvc
what s new in asp net mvc 31
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 32
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
Upgrading

ASP.NET MVC 3 Application Upgrader

tinyurl.com/upgrademvc3

multiple view engine support1
Multiple View Engine Support

protected void Application_Start()

{

ViewEngines.Engines.Add(newSparkViewFactory());

}

razor
Razor
  • Clean & Concise
  • Based on Existing Languages
  • Intellisense
  • Code Colorization
  • Unit Testing Support
syntax comparison
Syntax Comparison

<ul>

<% for (int i = 0; i < 10; i++) {%>

<li><%=i %></li>

<%} %>

</ul>

Web Forms

6 transitions

Razor

2 transitions

<ul>

@for (int i = 0; i < 10; i++)

{

<li>@i</li>

}

</ul>

layouts
Layouts

Layout

View

<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
Web Forms to Razor

Open Source Razor Converter

github.com/telerik/razor-converter

slide15
DEMO

Views using Razor

filters
Filters
  • Declarative
  • Cross-cutting concerns
  • Custom filters
  • Supported since version 1
types of filters
Types of Filters
  • IActionFilter
  • IResultFilter
  • IExceptionFilter
  • IAuthorizationFilter
filters example
Filters Example

[HandleError]

public class BlogController : Controller

{

[HandleLogging]

public ActionResult Index()

{ return View(); }

}

global filters
Global Filters
  • No longer need attributes
  • Applies to all actions on all controllers
global filters1
Global Filters

protected void Application_Start()

{

GlobalFilters.Filters.Add(new MyActionFilterAttribute());

}

slide21
DEMO

Logging Errors with Global Filters

dynamic viewbag
Dynamic ViewBag
  • Accessible via properties
  • Properties map to ViewData entries
  • Late-bound
dynamic viewbag1
Dynamic ViewBag

<head>

<title>@ViewBag.Title<title>

</head>

slide24
DEMO

Converting to Dynamic ViewBag

new action results
New Action Results
  • HttpNotFoundResult
  • RedirectResult
  • HttpStatusCodeResult
slide26
DEMO

Using New Action Results

javascript and ajax
JavaScript and AJAX
  • JSON Binding
  • jQuery Validation
  • Unobstrusive JavaScript
    • Separation of Presentation and Content
    • No errors if AJAX isn’t supported
  • RemoteAttribute
unobtrusive javascript
Unobtrusive JavaScript

web.config

<configuration>

<appSettings>

<add key="UnobtrusiveJavaScriptEnabled" value="true"/> </appSettings>

</configuration>

code

HtmlHelper.UnobtrusiveJavaScriptEnabled = true;

unobtrusive javascript1
Unobtrusive JavaScript

web.config

<configuration>

<appSettings>

<add key="UnobtrusiveJavaScriptEnabled" value="true"/> </appSettings>

</configuration>

code

HtmlHelper.UnobtrusiveJavaScriptEnabled = true;

client validation
Client Validation

web.config

<configuration>

<appSettings>

<add key=“ClientValidationEnabled" value="true"/> </appSettings>

</configuration>

code

HtmlHelper.ClientValidationEnabled = true;

slide31
DEMO

Remote Validation

resources
Resources

Software Application Developers

Infrastructure Professionals

http://technet.microsoft.com/

http://msdn.microsoft.com/

technetindia

msdnindia

@technetindia

@msdnindia

slide33

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