This documentation is archived and is not being maintained.

The following table lists technology areas each containing new features for ASP.NET 4.5 and Visual Studio 2012.

These features include the following:

The following table lists new features for core ASP.NET functionality.




Asynchronously reading and writing HTTP requests and responses

ASP.NET 4.5 can read, write, and flush a stream asynchronously. This asynchronicity lets you send data to a client incrementally without tying up operating system threads.

Asynchronously Reading and Writing HTTP Requests and Responses (What’s New whitepaper)

Support for reading unvalidated request data when request validation is enabled

ASP.NET 4.5 provides ways to read unvalidated request data so that you can allow users to pass markup for selected fields or pages.

New ASP.NET Request Validation Features (What’s New whitepaper)

Support for WebSockets protocol

Methods in the new System.Web.WebSockets namespace provide support for WebSockets protocol, which lets you read and write both string and binary data.

Support for WebSockets Protocol (What’s New whitepaper)

Bundling and minification of client scripts

ASP.NET 4.5 uses bundling (which combines separate JavaScript files for faster loading) and minification (which reduces the size of JavaScript and CSS files by removing unneeded characters). The ASP.NET bundling and minification library is also supported by the ScriptManager control.

New Bundling and Minification Support (ASP.NET 4.5 Series) (blog entry)

Bundling and Minification (article)

Bundling and Minification in ASP.NET 4.5 (blog entry)

Support for asynchronous modules and handlers

The new async and await keywords make it easier to write asynchronous HTTP modules and asynchronous HTTP handlers. Updates to asynchronous development include:

ClientDisconnectedToken: A CancellationToken that asynchronously notifies the application when a client has disconnected from the underlying web server.

TimedOutToken: A CancellationToken that asynchronously notifies the application when a request has run longer than the configured request timeout value.

ThreadAbortOnTimeout: If you want your application to control the behavior of timed out requests, set this property to false. When the property is set to true (the default), ASP.NET aborts the thread that is servicing the request when the request times out.

Abort: Use this method in your application to forcibly terminate the underlying TCP connection of a request. Any outstanding I/O will fail.

Support for await and Task-Based Asynchronous Modules and Handlers (What’s New whitepaper)

Using Asynchronous Methods in ASP.NET 4.5 (tutorial)

Using Asynchronous Methods in ASP.NET MVC 4 (tutorial)

async (C# Reference) (MSDN Library)

await (C# Reference) (MSDN Library)

Integrated Anti-XSS encoding routines

Anti-XSS (cross-site scripting) core encoding routines have been integrated into ASP.NET 4.5. These routines were previously available only as an external library.

Anti-XSS Library (What’s New whitepaper)

Support for OAuth and OpenID

OAuth and OpenID let you create sites that permit users to sign in with credentials from other sites, including Google, Yahoo, Facebook, Twitter, and Windows Live.

For more information, see What’s New in ASP.NET 4.5 and Visual Studio 2012 on the ASP.NET website.

The following table lists some of the enhancements that have been made for Web Forms in ASP.NET 4.5.




Model binders

Web Forms now supports model binding, which lets you bind data controls directly to data-access methods. ASP.NET automatically converts data from form fields, query strings, cookies, session state, and view state into method parameters. You can use these parameters to select data from or make updates to the database. (This technique is similar to model binding in ASP.NET MVC.)

Model Binding and Web Forms (tutorial series)

Model Binding (What’s New whitepaper)

Model Binding Part 1 – Selecting Data (video)

Model Binding Part 2 – Filtering (video)

Strongly typed binding expressions in data controls

You can now write strongly typed, two-way data-binding expressions in Web Forms data controls, instead of using Bind or Eval expressions. This approach lets you access complex properties in data controls. These expressions can be used with the new model binding feature.

Strongly typed data controls (What’s New whitepaper)

Strongly Typed Data Controls (blog entry)

Strongly typed data controls (video)

Unobtrusive JavaScript for client-side validation

Unobtrusive validation moves the code for client-side validation into a single external JavaScript file, which makes pages smaller and faster to load. It also provides better caching of script files.

Unobtrusive Validation (What’s New whitepaper)

HTML encoded data-binding expressions

New syntax lets you encode HTML output in page markup.

HTML Encoded Data-Binding Expressions (What’s New whitepaper)

Fallback support for content distribution networks (CDNs) in the ScriptManager control

When you set the EnableCdn property of the ScriptManager control, the control tests whether the script was loaded successfully from the CDN. If not, the control falls back to loading the script from an alternate (local) location.

ASP.NET 4.0 ScriptManager Improvements (blog entry)

Announcing the Microsoft AJAX CDN (blog entry)

Support for HTML5 form types

You can use HTML5 elements like email, tel, url, and search in Web Forms pages.

HTML5 Updates (What’s New whitepaper)

HTML 5 Input Types on WebForms Controls (blog entry)

Improved paging in the GridView control

The new AllowCustomPaging and VirtualItemCount properties of the GridView control let you customize paging functionality. These new properties remove the need for the control to retrieve all rows from the data source each time a new page is displayed.

AllowCustomPaging (MSDN Library)

VirtualItemCount (MSDN Library)

Enhancements to Web Forms compilation

The following improvements extend the Web Forms compilation system:

– A new ControlBuilderInterceptor class lets you customize Web Forms page and control compilation output.

– A new TemplateParser.ParseTemplate method lets you generate an ITemplate instance from a string of ASPX markup.

ControlBuilderInterceptor (MSDN Library)

ParseTemplate (MSDN Library)

ITemplate (MSDN Library)

Visual Studio 2012 RC is released – The Big Web Rollup (Scott Hanselman blog)

For more information, see What’s New in ASP.NET 4.5 and Visual Studio 2012 on the ASP.NET website and ASP.NET Data Access Content Map.

ASP.NET MVC 4 is available for Visual Studio 2010 SP1 at the Microsoft Download Center and for Visual Studio 2012 at ASP.NET MVC 4.

For information about new features in this release, see the following links on the ASP.NET website:

The ASP.NET Web Pages 2 is included in Visual Studio 2012 and Visual Studio Express 2012 for Web. You can also obtain it by using the Microsoft Web Platform Installer to download and install WebMatrix.

The following table lists enhancements for ASP.NET Web Pages that are included in the Web Pages 2.




New and enhanced site templates

A new Personal Site template provides pages for a blog, a photo gallery, and Twitter content. The Starter Site template has been updated to let users log in to your site by using Facebook, Twitter, and Windows Live. The Web Pages 1 site templates have also been upgraded to run on Web Pages 2.

The Top Features in Web Pages 2 (ASP.NET website)

Razor syntax improvements

Razor syntax now supports conditional HTML attributes, which makes it much simpler to render attributes based on values that you set in code. The new ~/ syntax also now makes it much simpler to render dynamic path information in links and URLs.

The Top Features in Web Pages 2 (ASP.NET website)


New options for validating user input are available, including client-side validation (which helps improve the performance of your site). New validation classes (ValidationHelper and Validator) help you specify validation rules by using just a few lines of code.

The Top Features in Web Pages 2 (ASP.NET website)

Side-by-side support

You can run existing Web Pages 1 applications and new Web Pages 2 applications on the same computer.

The Top Features in Web Pages 2 (ASP.NET website)

Membership and authentication

Web Pages supports new OAuth and OpenID authentication providers, which let users log in using external sites such as Facebook, Twitter, and Windows Live. The new Starter Site template includes examples of how to use the new providers.

The Top Features in Web Pages 2 (ASP.NET website)

Map helper

A new Map helper lets you call existing map engines (such as Bing, Google, Yahoo, and MapQuest) and render maps on your website.

The Top Features in Web Pages 2 (ASP.NET website)

Mobile display modes

A new Display Modes feature lets you create device-specific pages. The pages are rendered automatically based on the device that makes the request, such as a mobile device.

The Top Features in Web Pages 2 (ASP.NET website)

For more information about the ASP.NET Web Pages 2 release, see The Top Features in Web Pages 2 on the ASP.NET website.

ASP.NET MVC 4, ASP.NET Web API, and ASP.NET Web Pages v2 (Razor syntax) are now under the Apache 2.0 license. The essential points of this development model are as follows.

  • Source code location. The source code is available on CodePlex at and uses Git for version control.

  • See check-ins and provide feedback. The community can see and provide feedback on developer check-ins both from Microsoft and from the community.

  • Community contributions. Developers outside of Microsoft community can submit patches and code contributions.

  • Check-ins are evaluated. The Microsoft development team reviews every check-in (open source or otherwise) for inclusion. Every check-in is evaluated against existing standards.

  • Community code is included in Visual Studio. The community code approved for inclusion in ASP.NET is included in Visual Studio.

  • Microsoft development and support continue. ASP.NET MVC, Web API and Razor continue to be developed by Microsoft and ship both standalone as well as part of Visual Studio. They continue to be supported by existing Microsoft support policy.

  • Web Forms. Web Forms has not been made open source because it is part of System.Web.dll which the Windows Server platform takes a dependency on. Because of this dependency, the code cannot easily be replaced except when the .NET framework or the OS are updated.

For more information, see:

The following sections provide information about editor enhancements and new features in the Visual Studio 2012 release.

The following features in the web page designer are either new or have been enhanced for the Visual Studio 2012 release.

Page Inspector is a tool that renders a web page (HTML, Web Forms, ASP.NET MVC, or Web Pages) directly within the Visual Studio IDE. You can use Page Inspector to examine both the source code and the resulting output. For ASP.NET pages, you can use Page Inspector to determine which server-side code has produced the HTML markup that is rendered to the browser. Page Inspector works even when the default ASP.NET bundling and minification features are enabled.


To use Page Inspector, you must have the following:

  • Visual Studio 2012 installed on your computer.

  • .NET Framework 4.5 installed on your computer.

  • A Web application that targets the .NET Framework 4 or later.


Page Inspector hosts the current version of Internet Explorer in Visual Studio. For full functionality, you must have Internet Explorer 9 installed on your computer. You do not have to have Internet Explorer Platform Preview (also called Internet Explorer 10 Test Drive) installed.




Selection mapping

When you select markup in the source, the corresponding output is automatically highlighted in Page Inspector, and vice versa.

Inspect Mode

Click the arrow icon on the Page Inspector tools pane to put Page Inspector into inspection mode. In inspection mode, when you hold the mouse pointer over any part of the rendered page, the corresponding source markup or code is highlighted. In Solution Explorer, the corresponding file is also highlighted.

Sandbox testing of CSS/DOM changes

Page Inspector lets you modify CSS properties and DOM element attributes and see the changes reflected immediately in the browser. These changes are not persisted and the original source files are unaffected.

CSS Rule Mapping and Modification

When you click a rule in the CSS tools grid, Page Inspector opens the corresponding .css file to where the rule is defined. The complete rule is selected. This feature makes it easy for you to get to where the rule is defined so that you can modify it as necessary.

Update bar

When you change the page source, an update bar appears at the top of the viewer. The Update Bar prompts you to click the bar (or press CTRL+ALT+ENTER) to save the changes and refresh the rendered view.

Source file links

A Files tab on the Page Inspector tools pane contains links to all of the files that make up the current page. To open one of the files in the Visual Studio editor, click the file link.

Page Inspector in the default browser list

Page Inspector appears as an option in the drop-down list of browsers next to the Start Debugging icon in Visual Studio.


The HTML editor in Visual Studio provides support for HTML5. The following table lists additional enhancements.




Improved IntelliSense

As you type, IntelliSense reduces the options that are displayed to only the ones that contain the string that you typed. Matches can occur at the beginning, middle, or end. IntelliSense and validation have been updated to conform to the latest HTML5 and W3C standards.

Auto-reduce statement completion (What’s New whitepaper)

Schema switching based on document type

You can configure the HTML editor to use a page’s <!DOCTYPE> and <html> tags to automatically set the schema to use for validating the page markup.

Validation, HTML, Text Editor, Options Dialog Box (MSDN UI reference)

Tag completion when renaming tags

If you change a tag name (for example, <p> to <list>), the editor changes the corresponding beginning or end tag (for example, </p> automatically becomes </list>.

Automatic renaming of matching tag when you rename an opening or closing tag (What’s New whitepaper)

Extract selected markup to a user control

In the editor, you can save selected select markup as a user control, which is a convenient way to create markup for use in multiple locations. To do this, right-click the selection, choose Extract to User Control, and then save the markup.

Extract to User Control (What’s New whitepaper)

Smart indentation for empty elements

IF the insertion pointer is between an empty pair of tags (for example, <p></p>), when you press ENTER, the editor creates a new line. It puts the insertion point in an indented position on the new line, as in the following example:

Smart Indent (What’s New whitepaper)

Smart Task feature for HTML elements

Smart Tasks appear on HTML tags as a small arrow when the insertion point is inside the element. Click the arrow or press CTRL+. (dot) to display a small menu that helps you complete tasks related to the element. Smart Tasks are available in source view for all HTML elements and are extensible through the Managed Extensibility Framework.

HTML Editor Smart Tasks and Event Handler Generation

Event handler generation in source view

When you edit an event name in source view, you can use IntelliSense to create an event handler in the code that has the correct signature.

Event handler generation (What’s New whitepaper)

For more information, see What’s New in ASP.NET 4.5 and Visual Studio 2012 on the ASP.NET website.

The most significant change in the Visual Studio 2012 CSS editor is support for CSS3. For more information about CSS3, see The following table lists additional enhancements to the CSS editor in Visual Studio 2012.




Collapse/expand (outlining)

The expand and collapse feature (outlining) from the HTML page editor in Visual Studio has been added to CSS sections and commented section headings in .css files.

Custom regions (What’s New whitepaper)

Auto formatting

When you insert a CSS property, a colon is automatically added. When you type an opening brace (“”), a closing brace (“”) is added.

Hierarchical indentation

Parent and child relationships are now indented in the editing pane so that the CSS hierarchy is clearer.

Hierarchical indentation (What’s New whitepaper)

CSS Editor Hierarchical Indentation (video)

Auto-reducing statement completion

As you type, IntelliSense reduces the options that are displayed to only the ones that are appropriate. IntelliSense displays items that contain the string that you type regardless of whether the string occurs at the beginning, middle, or end of the matching item.

Auto-reduce statement completion (What’s New whitepaper)


The keyboard shortcuts for commenting and uncommenting in the HTML editor (CTRL+K, CTRL+C, and CTRL+K, CTRL+U) are now available in the CSS editor. (When a partially selected commented block is uncommented, the whole block is uncommented.)

Commenting and uncommenting support (What’s New whitepaper)

Color picker

When you type # or rgb( after any CSS property that takes a color value, a color picker is displayed that can insert the value for the color. The value is inserted in hexadecimal or other formats into the style sheet.

Color picker (What’s New whitepaper)

CSS Editor Color Picker (video)

Snippets for vendor-specific extensions to CSS

Snippets facilitate the entry of vendor-specific extensions like -ms-, -moz-, and -webkit-.

Snippets (What’s New whitepaper)

CSS Snippets (video)

Support for CSS hacks

Selector and property hacks like *color and _width are understood and validated.

CSS hacks support (What’s New whitepaper)

Conformance with W3C standards

The Visual Studio 2012 CSS schema follows W3C standards. For a complete list of the CSS modules supported in Visual Studio 2012, see the resource link.

Supported CSS module list

Browser-specific support for individual elements

The Visual Studio 2012 CSS editor knows what version of a particular browser supports specific properties, directives, pseudo-classes, elements and values. Supported browsers include Chrome, Firefox, Internet Explorer, Opera and Safari.

What’s New in ASP.NET 4.5 and Visual Studio 2012 (What’s New whitepaper)

Vendor-specific prefixes in IntelliSense with tooltip help for each

Typing a hyphen in the CSS editor displays a list of all Mozilla, Internet Explorer, Opera, and WebKit vendor-specific prefixes. If you select a prefix in the list with the mouse pointer, a tooltip displays help text for the selected entry.

Visual Studio 2012 RC is released – The Big Web Rollup (Scott Hanselman blog)

Examples in tooltips

When you type a property name in the CSS editor, a tooltip displays a helpful example that shows how values should be assigned to the property.

What’s New in ASP.NET 4.5 and Visual Studio 2012 (What’s New whitepaper)

For more information, see What’s New in ASP.NET 4.5 and Visual Studio 2012 on the ASP.NET website and New CSS Editor Improvements in Visual Studio (ASP.NET 4.5 Series).

For an overview of the Visual Studio deployment enhancements see this video: Dirt Simple Web and Database Deployment in Visual Studio 11.

The following table lists some of the enhancements to the deployment tools for Visual Studio 2012. All of these enhancements can also be installed in Visual Studio 2010 or Visual Web Developer 2010 Express by visiting the following link: Visual Studio 2010 Web Publish Update.




Import publish settings files from hosting providers

You can download a file from your hosting provider that contains the settings you need to publish your project, and you can import that file into Visual Studio so that you don’t have to enter the values manually.

How to: Deploy a Web Project Using One-Click Publish in Visual Studio

Link Web.config transformations to publish profiles

You can link Web.config transformation files to specific publish profiles, not just to build configurations. (For example, if you have a publish profile that’s named “Staging”, you can have a Web.config transformation file for it that’s named “Web.Staging.config”.) This makes deploying the same project to different environments easier.

Store encrypted credentials in publish profiles

Information tied to a publish profile is now stored in a separate .pubxml file for each profile, and by default passwords are stored in a .pubxml.user file that is not included in source control.

Publish Profiles section in What’s New in ASP.NET 4.5 and Visual Studio 2012

Specify the build configuration in the publish profile

You can specify the build configuration that should be deployed for a publish profile in the publish profile itself.

How to: Deploy a Web Project Using One-Click Publish in Visual Studio

Preview file and database changes before they are actually made on the destination server

The new preview feature enables you to see which files will be copied or deleted and what database changes will be applied to the database, and you can cancel before the changes are applied. In the case of file operations, you can selectively cancel updates or deletions of specific files.

How to: Deploy a Web Project Using One-Click Publish in Visual Studio

Deploy incremental database updates

After a database is deployed and you make new changes to the database schema, when you redeploy the project Visual Studio can automatically determine what changes need to be applied to the database. If you are using Entity Framework Code First Migrations, Visual Studio can automatically configure Code First Migrations to update the database to the latest version when the application runs.

How to: Deploy a Web Project Using One-Click Publish in Visual Studio

Additional publishing enhancements

– A cleaner and simpler publish user interface.

– The ability to run Entity Framework Code First migrations from the publish dialog.

– The ability to update connection strings in the Web.config file at publish time (including complex EF connection strings).

– Prompting for untrusted certificates during publish.

– Automatic conversion of Visual Studio 2010 publish profiles to Visual Studio 2012 format.

– The ability to publish from the command line using a publish profile. Example syntax follows.

   msbuild mywap.csproj /p:DeployOnBuild=true;PublishProfile=MyProfileName

Web Deployment Overview for Visual Studio and ASP.NET

How to: Deploy a Web Project Using One-Click Publish in Visual Studio

For more information, see Web Deployment Content Map for Visual Studio and ASP.NET.