SlideShare una empresa de Scribd logo
1 de 15
ASP.NET MVC 4
Developer Preview
    Jon Galloway
  SoCal Code Camp
Agenda
• Overall focus areas for ASP.NET MVC 4
• Installation overview and availability
• Top new features
Overall focus areas for ASP.NET MVC 4
Goal: Make ASP.NET MVC the best web platform for
building modern rich web apps

Themes
• Development and deployment
  Capitalize on the platform
   – The Razor view engine and some of the new helpers in ASP.NET MVC 3 came out of work done
     for ASP.NET Web Pages.
• Ajax
   – “Dash of Ajax”
   – Full single-page application
• HTML5, tablet, and mobile
• Cloud ready
Notable Breaking Changes
• There are issues when running ASP.NET
  MVC 3, ASP.NET MVC 4, and Windows Azure
  Tools for Visual Studio 2010 1.5 side by side.
• Installing ASP.NET MVC 4 Developer Preview
  breaks ASP.NET MVC 3 RTM (but not the
  ASP.NET MVC 3 Tool Update) applications.

• Workarounds detailed in release notes.
Requirements
• ASP.NET MVC 4: .NET Framework 4
• Tooling:
  – Visual Studio 2010 with Service Pack 1 or
  – Visual Web Developer Express 2010 with SP1
Major Features in MVC 4
• Enhancements to Default Project Templates
• Display Modes
• jQuery Mobile, the View Switcher, and
  Browser Overriding
• Mobile Project Template
• Recipes for Code Generation in Visual Studio
• Task Support for Asynchronous Controllers
Default Template Changes
• New Design
• Adaptive Rendering
Custom Modes
DisplayModes.Modes.Insert(0, new DefaultDisplayMode("iPhone")
{
    ContextCondition = (context =>
context.Request.UserAgent.IndexOf
        ("iPhone", StringComparison.OrdinalIgnoreCase) >= 0)
});




ViewsShared_Layout.iPhone.cshtml
Major Features in MVC 4
• Enhancements to Default Project Templates
• Display Modes
• jQuery Mobile, the View Switcher, and
  Browser Overriding
• Mobile Project Template
• Recipes for Code Generation in Visual Studio
• Task Support for Asynchronous Controllers
jQuery Mobile – Browser Switcher




   <body>
       @Html.Partial("_ViewSwitcher")
Recipes
• Modular tooling installed via NuGet
Async Support
[AsyncTimeout(2500)]
[HandleError(ExceptionType = typeof(TaskCanceledException), View = "TimedOut")]
public async Task<ActionResult> Index(string city,
    CancellationToken cancellationToken) {


    var newsService = new NewsService();
    var sportsService = new SportsService();


    return View("Common",
          new PortalViewModel {
          NewsHeadlines = await newsService.GetHeadlinesAsync(cancellationToken),
          SportsScores = await sportsService.GetScoresAsync(cancellationToken)
    });
}
Async Support
[AsyncTimeout(2500)]
[HandleError(ExceptionType = typeof(TaskCanceledException), View = "TimedOut")]
public async Task<ActionResult> Index(string city,
    CancellationToken cancellationToken) {


    var newsService = new NewsService();
    var sportsService = new SportsService();


    return View("Common",
          new PortalViewModel {
          NewsHeadlines = await newsService.GetHeadlinesAsync(cancellationToken),
          SportsScores = await sportsService.GetScoresAsync(cancellationToken)
    });
}
Other Goodies
Other Features (listed in public roadmap)
We haven’t spent time fleshing out every feature under consideration. The following items are on the top of
our mind. Some of them will be delivered by other teams.
•   CSS and JavaScript Bundling Integration ASP.NET MVC 4 will include CSS and JavaScript bundling. Bundling
    consolidates .css and .js files by combining multiple files into a single file and reduces the total size of the
    resulting (combined) file by removing unnecessary whitespace and comments (minification). This reduces
    both bandwidth usage and download times, which speeds up the rendering of web pages.
•   EF Code First Data Migrations. This provides support for migrating from one version of your database
    schema to the next without losing data.
•   Better support for functional and integration testing of application code.
•   WCF Web API support.
•   Ajax improvements across the board. We’re focusing reducing the friction that developers encounter
    when using Ajax with ASP.NET MVC.
•   HTML5 support for editor/display templates and HTML helpers. For example, editor templates to might
    render an input element with its type set to date instead of an input element with its type set to the
    default text when rendering a DateTime property. Likewise, existing HTML helpers such as TextBoxFor
    might also be updated to render an appropriate input element based on the model type.
•   Support for “donut hole” caching in Razor views and support for the Windows Server App Fabric caching
    provider.
•   A new AreaAttribute class for better security when using areas.

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Sitecore mvc
Sitecore mvcSitecore mvc
Sitecore mvc
 
Discuss About ASP.NET MVC 6 and ASP.NET MVC 5
Discuss About ASP.NET MVC 6 and ASP.NET MVC 5Discuss About ASP.NET MVC 6 and ASP.NET MVC 5
Discuss About ASP.NET MVC 6 and ASP.NET MVC 5
 
Ankor Presentation @ JavaOne San Francisco September 2014
Ankor Presentation @ JavaOne San Francisco September 2014Ankor Presentation @ JavaOne San Francisco September 2014
Ankor Presentation @ JavaOne San Francisco September 2014
 
AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS Basics
 
Best Angular Training Online: Angular tutorial | Learn Angular 2 to 10 |
Best Angular Training Online: Angular tutorial | Learn Angular 2 to 10 | Best Angular Training Online: Angular tutorial | Learn Angular 2 to 10 |
Best Angular Training Online: Angular tutorial | Learn Angular 2 to 10 |
 
JavaLand 2014 - Ankor.io Presentation
JavaLand 2014 - Ankor.io PresentationJavaLand 2014 - Ankor.io Presentation
JavaLand 2014 - Ankor.io Presentation
 
SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...
SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...
SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...
 
Angular patterns
Angular patternsAngular patterns
Angular patterns
 
Asp.net mvc basic introduction
Asp.net mvc basic introductionAsp.net mvc basic introduction
Asp.net mvc basic introduction
 
Get Started with ASP.NET Core Training, Tutorial - Beginner to Advance
Get Started with ASP.NET Core Training, Tutorial - Beginner to AdvanceGet Started with ASP.NET Core Training, Tutorial - Beginner to Advance
Get Started with ASP.NET Core Training, Tutorial - Beginner to Advance
 
ASP.NET 4.0 Roadmap
ASP.NET 4.0 RoadmapASP.NET 4.0 Roadmap
ASP.NET 4.0 Roadmap
 
Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013
 
Everything you need to know about HTML5 in 15 min
Everything you need to know about HTML5 in 15 minEverything you need to know about HTML5 in 15 min
Everything you need to know about HTML5 in 15 min
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
Deep Dive building solutions on the SharePoint Framework - SPS Brussels 2016
Deep Dive building solutions on the SharePoint Framework - SPS Brussels 2016Deep Dive building solutions on the SharePoint Framework - SPS Brussels 2016
Deep Dive building solutions on the SharePoint Framework - SPS Brussels 2016
 
All About Asp Net 4 0 Hosam Kamel
All About Asp Net 4 0  Hosam KamelAll About Asp Net 4 0  Hosam Kamel
All About Asp Net 4 0 Hosam Kamel
 
Angularjs Basics
Angularjs BasicsAngularjs Basics
Angularjs Basics
 
Serverless with Azure Functions
Serverless with Azure FunctionsServerless with Azure Functions
Serverless with Azure Functions
 
Sitecore MVC: Converting Web Forms sublayouts
Sitecore MVC: Converting Web Forms sublayoutsSitecore MVC: Converting Web Forms sublayouts
Sitecore MVC: Converting Web Forms sublayouts
 
Webinar MVC6
Webinar MVC6Webinar MVC6
Webinar MVC6
 

Destacado

Asp.net templated razor delegates
Asp.net templated razor delegatesAsp.net templated razor delegates
Asp.net templated razor delegates
LearningTech
 
DDD Sydney 20111 Razor Session
DDD Sydney 20111 Razor SessionDDD Sydney 20111 Razor Session
DDD Sydney 20111 Razor Session
Mohamed Meligy
 
Getting Started with ASP.NET MVC 3 and Razor
Getting Started with ASP.NET MVC 3 and RazorGetting Started with ASP.NET MVC 3 and Razor
Getting Started with ASP.NET MVC 3 and Razor
Dan Wahlin
 

Destacado (14)

Simple mvc4 prepared by gigin krishnan
Simple mvc4 prepared by gigin krishnanSimple mvc4 prepared by gigin krishnan
Simple mvc4 prepared by gigin krishnan
 
Asp.net templated razor delegates
Asp.net templated razor delegatesAsp.net templated razor delegates
Asp.net templated razor delegates
 
ASP.NET MVC One Step Deeper
ASP.NET MVC One Step DeeperASP.NET MVC One Step Deeper
ASP.NET MVC One Step Deeper
 
Views
ViewsViews
Views
 
Template Layout Overrides - a beginner's guide
Template Layout Overrides - a beginner's guideTemplate Layout Overrides - a beginner's guide
Template Layout Overrides - a beginner's guide
 
DDD Sydney 20111 Razor Session
DDD Sydney 20111 Razor SessionDDD Sydney 20111 Razor Session
DDD Sydney 20111 Razor Session
 
Razor and the Art of Templating
Razor and the Art of TemplatingRazor and the Art of Templating
Razor and the Art of Templating
 
Hadoop-BigData
Hadoop-BigDataHadoop-BigData
Hadoop-BigData
 
ASP.NET MVC 3
ASP.NET MVC 3ASP.NET MVC 3
ASP.NET MVC 3
 
Net 451 in action
Net 451 in actionNet 451 in action
Net 451 in action
 
What’s New and Hot in .NET 4.0
What’s New and Hot in .NET 4.0What’s New and Hot in .NET 4.0
What’s New and Hot in .NET 4.0
 
Asp.Net MVC - Razor Syntax
Asp.Net MVC - Razor SyntaxAsp.Net MVC - Razor Syntax
Asp.Net MVC - Razor Syntax
 
Getting Started with ASP.NET MVC 3 and Razor
Getting Started with ASP.NET MVC 3 and RazorGetting Started with ASP.NET MVC 3 and Razor
Getting Started with ASP.NET MVC 3 and Razor
 
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
 

Similar a SoCal Code Camp 2011 - ASP.NET MVC 4

Targeting Mobile Platform with MVC 4.0
Targeting Mobile Platform with MVC 4.0Targeting Mobile Platform with MVC 4.0
Targeting Mobile Platform with MVC 4.0
Mayank Srivastava
 

Similar a SoCal Code Camp 2011 - ASP.NET MVC 4 (20)

MVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming modelMVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming model
 
ASP .Net Core SPA Templates
ASP .Net Core SPA TemplatesASP .Net Core SPA Templates
ASP .Net Core SPA Templates
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentation
 
ASP.NET Core 1.0
ASP.NET Core 1.0ASP.NET Core 1.0
ASP.NET Core 1.0
 
SynapseIndia asp.net2.0 ajax Development
SynapseIndia asp.net2.0 ajax DevelopmentSynapseIndia asp.net2.0 ajax Development
SynapseIndia asp.net2.0 ajax Development
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...
 
What's New in .Net 4.5
What's New in .Net 4.5What's New in .Net 4.5
What's New in .Net 4.5
 
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
 
Building API in the cloud using Azure Functions
Building API in the cloud using Azure FunctionsBuilding API in the cloud using Azure Functions
Building API in the cloud using Azure Functions
 
Building intranet applications with ASP.NET AJAX and jQuery
Building intranet applications with ASP.NET AJAX and jQueryBuilding intranet applications with ASP.NET AJAX and jQuery
Building intranet applications with ASP.NET AJAX and jQuery
 
Angular 2.0
Angular  2.0Angular  2.0
Angular 2.0
 
The future of ASP.NET / CodeCamp/Iasi 25 Oct 2014
The future of ASP.NET / CodeCamp/Iasi 25 Oct 2014The future of ASP.NET / CodeCamp/Iasi 25 Oct 2014
The future of ASP.NET / CodeCamp/Iasi 25 Oct 2014
 
Asp 1a-aspnetmvc
Asp 1a-aspnetmvcAsp 1a-aspnetmvc
Asp 1a-aspnetmvc
 
Aspnetmvc 1
Aspnetmvc 1Aspnetmvc 1
Aspnetmvc 1
 
Mvc4
Mvc4Mvc4
Mvc4
 
Targeting Mobile Platform with MVC 4.0
Targeting Mobile Platform with MVC 4.0Targeting Mobile Platform with MVC 4.0
Targeting Mobile Platform with MVC 4.0
 
Chinnasamy Manickam
Chinnasamy ManickamChinnasamy Manickam
Chinnasamy Manickam
 
ASP.net MVC Introduction Wikilogia (nov 2014)
ASP.net MVC Introduction Wikilogia (nov 2014)ASP.net MVC Introduction Wikilogia (nov 2014)
ASP.net MVC Introduction Wikilogia (nov 2014)
 
Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015
 

Más de Jon Galloway

Pragmatic JavaScript (DevConnections 2011)
Pragmatic JavaScript (DevConnections 2011)Pragmatic JavaScript (DevConnections 2011)
Pragmatic JavaScript (DevConnections 2011)
Jon Galloway
 
SoCal Code Camp 2011 - ASP.NET 4.5
SoCal Code Camp 2011 - ASP.NET 4.5SoCal Code Camp 2011 - ASP.NET 4.5
SoCal Code Camp 2011 - ASP.NET 4.5
Jon Galloway
 

Más de Jon Galloway (13)

What's new in Visual Studio for Mac for .NET Developers
What's new in Visual Studio for Mac for .NET DevelopersWhat's new in Visual Studio for Mac for .NET Developers
What's new in Visual Studio for Mac for .NET Developers
 
.NET Core Today and Tomorrow
.NET Core Today and Tomorrow.NET Core Today and Tomorrow
.NET Core Today and Tomorrow
 
ASP.NET Core 3.0 Deep Dive
ASP.NET Core 3.0 Deep DiveASP.NET Core 3.0 Deep Dive
ASP.NET Core 3.0 Deep Dive
 
What you need to know about .NET Core 3.0 and beyond
What you need to know about .NET Core 3.0 and beyondWhat you need to know about .NET Core 3.0 and beyond
What you need to know about .NET Core 3.0 and beyond
 
Techorama 2019 - ASP.NET Core One Hour Makeover
Techorama 2019 - ASP.NET Core One Hour MakeoverTechorama 2019 - ASP.NET Core One Hour Makeover
Techorama 2019 - ASP.NET Core One Hour Makeover
 
Whats New in ASP.NET Core
Whats New in ASP.NET CoreWhats New in ASP.NET Core
Whats New in ASP.NET Core
 
.NET Core Previews - New Features in .NET Core and ASP.NET Core 2.1, Blazor a...
.NET Core Previews - New Features in .NET Core and ASP.NET Core 2.1, Blazor a....NET Core Previews - New Features in .NET Core and ASP.NET Core 2.1, Blazor a...
.NET Core Previews - New Features in .NET Core and ASP.NET Core 2.1, Blazor a...
 
Keynote: Hijacking Boring Sounding Things Like Foundations and Maturity Model...
Keynote: Hijacking Boring Sounding Things Like Foundations and Maturity Model...Keynote: Hijacking Boring Sounding Things Like Foundations and Maturity Model...
Keynote: Hijacking Boring Sounding Things Like Foundations and Maturity Model...
 
What's New in ASP.NET Core 2.0
What's New in ASP.NET Core 2.0What's New in ASP.NET Core 2.0
What's New in ASP.NET Core 2.0
 
[NDC Oslo 2017] Open Source Software Foundations: Not Totally Boring, Actuall...
[NDC Oslo 2017] Open Source Software Foundations: Not Totally Boring, Actuall...[NDC Oslo 2017] Open Source Software Foundations: Not Totally Boring, Actuall...
[NDC Oslo 2017] Open Source Software Foundations: Not Totally Boring, Actuall...
 
learning to love html and css
learning to love html and csslearning to love html and css
learning to love html and css
 
Pragmatic JavaScript (DevConnections 2011)
Pragmatic JavaScript (DevConnections 2011)Pragmatic JavaScript (DevConnections 2011)
Pragmatic JavaScript (DevConnections 2011)
 
SoCal Code Camp 2011 - ASP.NET 4.5
SoCal Code Camp 2011 - ASP.NET 4.5SoCal Code Camp 2011 - ASP.NET 4.5
SoCal Code Camp 2011 - ASP.NET 4.5
 

Último

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Último (20)

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

SoCal Code Camp 2011 - ASP.NET MVC 4

  • 1. ASP.NET MVC 4 Developer Preview Jon Galloway SoCal Code Camp
  • 2. Agenda • Overall focus areas for ASP.NET MVC 4 • Installation overview and availability • Top new features
  • 3. Overall focus areas for ASP.NET MVC 4 Goal: Make ASP.NET MVC the best web platform for building modern rich web apps Themes • Development and deployment Capitalize on the platform – The Razor view engine and some of the new helpers in ASP.NET MVC 3 came out of work done for ASP.NET Web Pages. • Ajax – “Dash of Ajax” – Full single-page application • HTML5, tablet, and mobile • Cloud ready
  • 4. Notable Breaking Changes • There are issues when running ASP.NET MVC 3, ASP.NET MVC 4, and Windows Azure Tools for Visual Studio 2010 1.5 side by side. • Installing ASP.NET MVC 4 Developer Preview breaks ASP.NET MVC 3 RTM (but not the ASP.NET MVC 3 Tool Update) applications. • Workarounds detailed in release notes.
  • 5. Requirements • ASP.NET MVC 4: .NET Framework 4 • Tooling: – Visual Studio 2010 with Service Pack 1 or – Visual Web Developer Express 2010 with SP1
  • 6. Major Features in MVC 4 • Enhancements to Default Project Templates • Display Modes • jQuery Mobile, the View Switcher, and Browser Overriding • Mobile Project Template • Recipes for Code Generation in Visual Studio • Task Support for Asynchronous Controllers
  • 7. Default Template Changes • New Design • Adaptive Rendering
  • 8. Custom Modes DisplayModes.Modes.Insert(0, new DefaultDisplayMode("iPhone") { ContextCondition = (context => context.Request.UserAgent.IndexOf ("iPhone", StringComparison.OrdinalIgnoreCase) >= 0) }); ViewsShared_Layout.iPhone.cshtml
  • 9. Major Features in MVC 4 • Enhancements to Default Project Templates • Display Modes • jQuery Mobile, the View Switcher, and Browser Overriding • Mobile Project Template • Recipes for Code Generation in Visual Studio • Task Support for Asynchronous Controllers
  • 10. jQuery Mobile – Browser Switcher <body> @Html.Partial("_ViewSwitcher")
  • 11. Recipes • Modular tooling installed via NuGet
  • 12.
  • 13. Async Support [AsyncTimeout(2500)] [HandleError(ExceptionType = typeof(TaskCanceledException), View = "TimedOut")] public async Task<ActionResult> Index(string city, CancellationToken cancellationToken) { var newsService = new NewsService(); var sportsService = new SportsService(); return View("Common", new PortalViewModel { NewsHeadlines = await newsService.GetHeadlinesAsync(cancellationToken), SportsScores = await sportsService.GetScoresAsync(cancellationToken) }); }
  • 14. Async Support [AsyncTimeout(2500)] [HandleError(ExceptionType = typeof(TaskCanceledException), View = "TimedOut")] public async Task<ActionResult> Index(string city, CancellationToken cancellationToken) { var newsService = new NewsService(); var sportsService = new SportsService(); return View("Common", new PortalViewModel { NewsHeadlines = await newsService.GetHeadlinesAsync(cancellationToken), SportsScores = await sportsService.GetScoresAsync(cancellationToken) }); }
  • 15. Other Goodies Other Features (listed in public roadmap) We haven’t spent time fleshing out every feature under consideration. The following items are on the top of our mind. Some of them will be delivered by other teams. • CSS and JavaScript Bundling Integration ASP.NET MVC 4 will include CSS and JavaScript bundling. Bundling consolidates .css and .js files by combining multiple files into a single file and reduces the total size of the resulting (combined) file by removing unnecessary whitespace and comments (minification). This reduces both bandwidth usage and download times, which speeds up the rendering of web pages. • EF Code First Data Migrations. This provides support for migrating from one version of your database schema to the next without losing data. • Better support for functional and integration testing of application code. • WCF Web API support. • Ajax improvements across the board. We’re focusing reducing the friction that developers encounter when using Ajax with ASP.NET MVC. • HTML5 support for editor/display templates and HTML helpers. For example, editor templates to might render an input element with its type set to date instead of an input element with its type set to the default text when rendering a DateTime property. Likewise, existing HTML helpers such as TextBoxFor might also be updated to render an appropriate input element based on the model type. • Support for “donut hole” caching in Razor views and support for the Windows Server App Fabric caching provider. • A new AreaAttribute class for better security when using areas.