ASP.NET MVC 4 – New Features By Mayank Srivastava MPS Partners LLC
About me Mayank Srivastava Senior Consultant / Specialist Web, MPS Partners LLC. http://MayankSrivastava.com MayankSri@Live.com MayankSri CNUG07-18-2012
Know your audience • Experience on ASP.NET MVC prior versions? • Understanding of ASP.NET MVC framework? • jQuery Mobile / HTML 5? CNUG07-18-2012
Topics • Quick Look • Solution Templates – Web and Mobile • Cloud Ready • Controller Anywhere • Cleaner Global.ascx.cs • Display Modes and Mobile Features • Web APIs • Bundling and minification • Task-based async controllers • Razor enhancements CNUG07-18-2012
Quick Look CNUG07-18-2012
The Mobile Buzz… Why Target Mobile Platform? CNUG07-18-2012
Case for Mobile CNUG07-18-2012 World’s population 7 billion Total Mobile Broadband Users Hit 1 Billion in 2011 The new primary way to browse the web.
Top 10 CIO Technology Priorities in 2012 - SurveybyGartner 1. Analytics and business intelligence. (Last year's rank: 5) 2. Mobile technologies. (Last year's rank : 3) 3. Cloud computing, including SaaS. (Last year's rank : 1) 4. Collaboration/workflow technologies. (Last year's rank : 8) 5. Legacy modernization. 6. IT management. (Last year's rank : 4) 7. CRM 8. ERP applications 9. Security 10. Virtualization. (Last year's rank : 2) CNUG07-18-2012
Building a Mobile Web App Leveraging your existing skills to build Mobile applications. What are the options? Client Side: HTML 5 / CSS 3 – Meta Viewport tag / Media Queries Server Side ASP.NET MVC – Display Modes CNUG07-18-2012
Client side: CSS style – Pre HTML 5 CNUG07-18-2012
What is HTML 5 • New version of HTML • A new standard UI platform. • Accepted on wide verity of platforms, not just web • Metro Apps • Apple web kit • Android platform • Packaging HTML 5 Websites as Apps using Phone Gap (aka Adobe Cordova) http://phonegap.com/ CNUG07-18-2012
Client side : Adaptive rendering Problems: Bandwidth -Amount of data sent over the wire same whether mobile or desktop. Application performance – Potentially additional data fetch for mobile. User Experience – Smaller screen might need simpler UI design (button/links). CNUG07-18-2012 DAL Business Logic Presentation Logic (URL) Desktop Browser IE Mobile Win Phone Safari iPhone Safari iPad DB Web Application BrowsersStandard markup
Server side : Display Modes Being able to send different views to different devices. CNUG07-18-2012 DAL Business Logic Presentation Logic (URL) Desktop Browser IE Mobile Win Ph 7 Safari iPhone Safari iPad DB Web Application BrowsersClient specific markup
Demo • Display modes • jQuery Mobile CNUG07-18-2012
Web API • A framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices • A platform for building RESTful applications on the .NET Framework • New landing page - http://www.asp.net/web-api • Demo from Channel 9 http://www.asp.net/web-api/samples CNUG07-18-2012
Improvements to Mobile Web CNUG07-18-2012 DAL Business Logic Web API Desktop Browser IE Mobile Win Ph 7 Safari iPhone Safari iPad DB Web Application BrowsersClient specific HTML & JS based App Web App Web App Web App Web App
Client side JavaScript libraries • Knockout.js • http://knockoutjs.com/ • http://learn.knockoutjs.com/ • History.js • https://github.com/balupton/history.js/wiki/Showcase • Upshot.js http://nuget.org/packages/upshot Single page Applications • http://code.msdn.microsoft.com/ASPNET-Single-Page-d6d7172c CNUG07-18-2012
Web APIs Demo CNUG07-18-2012
Bundling and Minification CNUG07-18-2012 Productivity feature Compression and bundling • CSS • JavaScript • Folder Bundles • Declarative Static bundles • Custom Dynamic bundles
Async Controllers Old Event-based Asynchronous Pattern CNUG07-18-2012
Async Controllers Task based asynchronous pattern CNUG07-18-2012
Razor Enhancements • Use of ~ as Root. CNUG07-18-2012
Download DEMO & Slides http://blogs.MPSPartners.com/MayankSrivastava/Default.aspx Also http://www.MayankSrivastava.com/ CNUG07-18-2012 Questions

CNUG ASP.NET MVC 4 – New Features

  • 1.
    ASP.NET MVC 4– New Features By Mayank Srivastava MPS Partners LLC
  • 2.
    About me Mayank Srivastava SeniorConsultant / Specialist Web, MPS Partners LLC. http://MayankSrivastava.com MayankSri@Live.com MayankSri CNUG07-18-2012
  • 3.
    Know your audience •Experience on ASP.NET MVC prior versions? • Understanding of ASP.NET MVC framework? • jQuery Mobile / HTML 5? CNUG07-18-2012
  • 4.
    Topics • Quick Look •Solution Templates – Web and Mobile • Cloud Ready • Controller Anywhere • Cleaner Global.ascx.cs • Display Modes and Mobile Features • Web APIs • Bundling and minification • Task-based async controllers • Razor enhancements CNUG07-18-2012
  • 5.
  • 6.
    The Mobile Buzz… WhyTarget Mobile Platform? CNUG07-18-2012
  • 7.
    Case for Mobile CNUG07-18-2012 World’spopulation 7 billion Total Mobile Broadband Users Hit 1 Billion in 2011 The new primary way to browse the web.
  • 8.
    Top 10 CIOTechnology Priorities in 2012 - SurveybyGartner 1. Analytics and business intelligence. (Last year's rank: 5) 2. Mobile technologies. (Last year's rank : 3) 3. Cloud computing, including SaaS. (Last year's rank : 1) 4. Collaboration/workflow technologies. (Last year's rank : 8) 5. Legacy modernization. 6. IT management. (Last year's rank : 4) 7. CRM 8. ERP applications 9. Security 10. Virtualization. (Last year's rank : 2) CNUG07-18-2012
  • 9.
    Building a MobileWeb App Leveraging your existing skills to build Mobile applications. What are the options? Client Side: HTML 5 / CSS 3 – Meta Viewport tag / Media Queries Server Side ASP.NET MVC – Display Modes CNUG07-18-2012
  • 10.
    Client side: CSSstyle – Pre HTML 5 CNUG07-18-2012
  • 11.
    What is HTML5 • New version of HTML • A new standard UI platform. • Accepted on wide verity of platforms, not just web • Metro Apps • Apple web kit • Android platform • Packaging HTML 5 Websites as Apps using Phone Gap (aka Adobe Cordova) http://phonegap.com/ CNUG07-18-2012
  • 12.
    Client side :Adaptive rendering Problems: Bandwidth -Amount of data sent over the wire same whether mobile or desktop. Application performance – Potentially additional data fetch for mobile. User Experience – Smaller screen might need simpler UI design (button/links). CNUG07-18-2012 DAL Business Logic Presentation Logic (URL) Desktop Browser IE Mobile Win Phone Safari iPhone Safari iPad DB Web Application BrowsersStandard markup
  • 13.
    Server side :Display Modes Being able to send different views to different devices. CNUG07-18-2012 DAL Business Logic Presentation Logic (URL) Desktop Browser IE Mobile Win Ph 7 Safari iPhone Safari iPad DB Web Application BrowsersClient specific markup
  • 14.
    Demo • Display modes •jQuery Mobile CNUG07-18-2012
  • 15.
    Web API • Aframework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices • A platform for building RESTful applications on the .NET Framework • New landing page - http://www.asp.net/web-api • Demo from Channel 9 http://www.asp.net/web-api/samples CNUG07-18-2012
  • 16.
    Improvements to MobileWeb CNUG07-18-2012 DAL Business Logic Web API Desktop Browser IE Mobile Win Ph 7 Safari iPhone Safari iPad DB Web Application BrowsersClient specific HTML & JS based App Web App Web App Web App Web App
  • 17.
    Client side JavaScriptlibraries • Knockout.js • http://knockoutjs.com/ • http://learn.knockoutjs.com/ • History.js • https://github.com/balupton/history.js/wiki/Showcase • Upshot.js http://nuget.org/packages/upshot Single page Applications • http://code.msdn.microsoft.com/ASPNET-Single-Page-d6d7172c CNUG07-18-2012
  • 18.
  • 19.
    Bundling and Minification CNUG07-18-2012 Productivityfeature Compression and bundling • CSS • JavaScript • Folder Bundles • Declarative Static bundles • Custom Dynamic bundles
  • 20.
    Async Controllers Old Event-basedAsynchronous Pattern CNUG07-18-2012
  • 21.
    Async Controllers Task basedasynchronous pattern CNUG07-18-2012
  • 22.
    Razor Enhancements • Useof ~ as Root. CNUG07-18-2012
  • 23.
    Download DEMO &Slides http://blogs.MPSPartners.com/MayankSrivastava/Default.aspx Also http://www.MayankSrivastava.com/ CNUG07-18-2012 Questions