what’s new in asp.net 4.5 and visual studio 11 tooling
DESCRIPTION
The first session dives right into what’s new in the platform and in Visual Studio tooling for web development. We’ll cover the new HTML, JavaScript and CSS editors and use the new Page Inspector to debug HTML output and more. This session finishes with ASP.NET Web Pages 2 in combination with the Razor syntax, a new approachable and lightweight way to create web content. A great starter to kick-off the day!TRANSCRIPT
![Page 1: What’s new in ASP.NET 4.5 and Visual Studio 11 Tooling](https://reader030.vdocuments.us/reader030/viewer/2022020217/54bb98424a7959a8178b462b/html5/thumbnails/1.jpg)
What’s new in ASP.NET 4.5 And Visual Studio 11
JurgenPostelmansU2U
![Page 2: What’s new in ASP.NET 4.5 and Visual Studio 11 Tooling](https://reader030.vdocuments.us/reader030/viewer/2022020217/54bb98424a7959a8178b462b/html5/thumbnails/2.jpg)
Session Contents• Visual Studio 11 Enhancements• Unobtrusive Validation• Request Validation Enhacements• Cross Site Scripting• Bundling and Minification
![Page 3: What’s new in ASP.NET 4.5 and Visual Studio 11 Tooling](https://reader030.vdocuments.us/reader030/viewer/2022020217/54bb98424a7959a8178b462b/html5/thumbnails/3.jpg)
Visual Studio 11
• IIS Express by default for new Web Sites• ASP.NET Development Server still included for backward
compatibility• LocalDB default database server• ASP.NET Project Templates (not implemented yet)• Unify all templates over Web Forms, MVC and Web Pages• Build in mobile support
![Page 4: What’s new in ASP.NET 4.5 and Visual Studio 11 Tooling](https://reader030.vdocuments.us/reader030/viewer/2022020217/54bb98424a7959a8178b462b/html5/thumbnails/4.jpg)
HTML Editor Enhancements• Source View Smart Tasks• Automatic Event Handler generation
• Element Matching• Extract To User Control• Highlight the a piece of code, right-click and select Extract
to User Control in menu• Smart Indentation
![Page 5: What’s new in ASP.NET 4.5 and Visual Studio 11 Tooling](https://reader030.vdocuments.us/reader030/viewer/2022020217/54bb98424a7959a8178b462b/html5/thumbnails/5.jpg)
HTML5 Enhancements
• ASP.NET Web Forms defaults to XHTML5 doctype• ‘Use DocType’ button in toolbar
• Support for new HTML5 form controls• Enhanched TextMode property on TextBox control
![Page 6: What’s new in ASP.NET 4.5 and Visual Studio 11 Tooling](https://reader030.vdocuments.us/reader030/viewer/2022020217/54bb98424a7959a8178b462b/html5/thumbnails/6.jpg)
CSS Editor Enhancements• CSS Editor Hierarchical Indentation• CSS Editor Snippets• CSS Color Picker• Better Cross Browser support
![Page 7: What’s new in ASP.NET 4.5 and Visual Studio 11 Tooling](https://reader030.vdocuments.us/reader030/viewer/2022020217/54bb98424a7959a8178b462b/html5/thumbnails/7.jpg)
Javascript Editor Enhancements• Support for ECMAScript 5 and HTML5 DOM• Auto-reducing Statement Completion List in
IntelliSense• IntelliSense show function signature• Support for • Go To Definition• Brace Matching• Outlining
![Page 8: What’s new in ASP.NET 4.5 and Visual Studio 11 Tooling](https://reader030.vdocuments.us/reader030/viewer/2022020217/54bb98424a7959a8178b462b/html5/thumbnails/8.jpg)
Page Inspector• Delivers integrated browser experience in Visual
Studio• Installed separately via Web Platform Installer
• Live DOM and CSS Visualizer and Editor• Inspect DOM elements• Alter their CSS on the fly
![Page 9: What’s new in ASP.NET 4.5 and Visual Studio 11 Tooling](https://reader030.vdocuments.us/reader030/viewer/2022020217/54bb98424a7959a8178b462b/html5/thumbnails/9.jpg)
Unobtrusive Validation• In ASP.NET 4.0 Validators generated inline JavaScript
for client-side validation• Increases page size• HTML source is cluttered
• Unobtrusive Validation uses HTML5 data attributes and jQuery
• Enabled by default via web.config or in code
![Page 10: What’s new in ASP.NET 4.5 and Visual Studio 11 Tooling](https://reader030.vdocuments.us/reader030/viewer/2022020217/54bb98424a7959a8178b462b/html5/thumbnails/10.jpg)
Request Validation• In ASP.NET 4.0 • Request validation enabled by default and could only be
disabled at the page level
![Page 11: What’s new in ASP.NET 4.5 and Visual Studio 11 Tooling](https://reader030.vdocuments.us/reader030/viewer/2022020217/54bb98424a7959a8178b462b/html5/thumbnails/11.jpg)
Request Validation• ASP.NET 4.5 enhancements• Disable request validation on a single control• ValidateRequestMode attribute on ASP.NET Control
• Lazy Request Validation• Validation only done when value is accessed explicitly
• i.e.: Request.Form[“<key>”]• In web.config
• Set ValidateRequestMode on control to Disabled• To access the un-validated request manually
• i.e.: Request.Unvalidated.Form[“<key>”]• Be careful with this
![Page 12: What’s new in ASP.NET 4.5 and Visual Studio 11 Tooling](https://reader030.vdocuments.us/reader030/viewer/2022020217/54bb98424a7959a8178b462b/html5/thumbnails/12.jpg)
Cross Site Scripting • Enables hackers to inject client-site script in your page• Prior to ASP.NET 4.5 the default HTML encoder is
vulnerable to XSS attacks• ASP.NET 4.5 has the AntiXssEncoder builtin• Configured as the default encoder via web.config on new
projects
• Used everywhere except for data binding expressions• Use the new <%#: <your expression> %> syntax there
![Page 13: What’s new in ASP.NET 4.5 and Visual Studio 11 Tooling](https://reader030.vdocuments.us/reader030/viewer/2022020217/54bb98424a7959a8178b462b/html5/thumbnails/13.jpg)
Bundling And Minification
• Modern HTML pages can include lots of CSS and JavaScript references• Each one is retrieved with a separate HTTP request• Not automatically minified
• ASP.NET 4.5 can bundle and minify your JavaScript and CSS
![Page 14: What’s new in ASP.NET 4.5 and Visual Studio 11 Tooling](https://reader030.vdocuments.us/reader030/viewer/2022020217/54bb98424a7959a8178b462b/html5/thumbnails/14.jpg)
JavaScript Bundling And Minification• Default JavaScript bundling behavior• Take all JavaScript files in a certain folder • Sort them alphabetically• Then reordered so that know libraries are
loaded first (jQuery, Dojo, MooTools)• The default bundle is called “js”• Include the following script link to load the
default bundle in your page
![Page 15: What’s new in ASP.NET 4.5 and Visual Studio 11 Tooling](https://reader030.vdocuments.us/reader030/viewer/2022020217/54bb98424a7959a8178b462b/html5/thumbnails/15.jpg)
CSS Bundling And Minification• Default CSS bundling behavior• Take all CSS files in a certain folder • Sort them alphabetically• Then reorganized so that reset.css and normalize.css
come before any other CSS file• The default bundle is called “css”• Include the following script link to load the default
bundle in your page
![Page 16: What’s new in ASP.NET 4.5 and Visual Studio 11 Tooling](https://reader030.vdocuments.us/reader030/viewer/2022020217/54bb98424a7959a8178b462b/html5/thumbnails/16.jpg)
Bundling And Minification
• You can register your own bundles in Global.asax for custom processing
• Referencing your custom bundle
![Page 17: What’s new in ASP.NET 4.5 and Visual Studio 11 Tooling](https://reader030.vdocuments.us/reader030/viewer/2022020217/54bb98424a7959a8178b462b/html5/thumbnails/17.jpg)
Q&A
![Page 18: What’s new in ASP.NET 4.5 and Visual Studio 11 Tooling](https://reader030.vdocuments.us/reader030/viewer/2022020217/54bb98424a7959a8178b462b/html5/thumbnails/18.jpg)
© 2012 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.
![Page 19: What’s new in ASP.NET 4.5 and Visual Studio 11 Tooling](https://reader030.vdocuments.us/reader030/viewer/2022020217/54bb98424a7959a8178b462b/html5/thumbnails/19.jpg)
Be what’s next• Find everything here
http://aka.ms/mbl-tech• Visual Studio Developer Preview Downloads
http://aka.ms/mbl-tech/devprev• MSDN HTML5 Developer Center
http://aka.ms/mbl-tech/html5