Thursday, 1 March 2012

ASP.NET 4.5 Beta. Visual Studio 11 Beta also includes enhancements and new features for improved web development

The .NET Framework 4.5 Beta includes enhancements for ASP.NET 4.5 Beta. Visual Studio 11 Beta also includes enhancements and new features for improved web development. This document provides an overview of many of the new features that are included in the Beta release. For more detailed information, see What’s New in ASP.NET 4.5 and Visual Studio 11 for Web on the website.
This topic contains the following sections:
The following table lists new features for core ASP.NET functionality.
Asynchronously reading and writing HTTP requests and responses
ASP.NET 4.5 Beta can read, write, and flush a stream asynchronously. This 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 Beta 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 Beta 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).
New Bundling and Minification Support (ASP.NET 4.5 Series) (blog entry)
Bundling and Minification in ASP.NET 4.5 (blog entry)
Support for asynchronous modules and handlers
The new await and async keywords make it easier to write asynchronous HTTP modules and asynchronous HTTP handlers.
Support for await and Task-Based Asynchronous Modules and Handlers (What's New whitepaper)
Integrated Anti-XSS encoding routines
Anti-XSS (cross-site scripting) core encoding routines have been integrated into ASP.NET 4.5 Beta. These were previously available only as an external library.
Anti-XSS Library (What's New whitepaper)
For more information, see What’s New in ASP.NET 4.5 and Visual Studio 11 Developer on the website.
The following table lists some of the enhancements that have been made for Web Forms in ASP.NET 4.5 Beta.
Model binders
Web Forms now supports model binding, which lets you bind data controls directly to data-access methods. ASP.NET will automatically convert data from form fields, query strings, cookies, session state, and view state into method parameters that you can use to select from or update the database. (This is similar to model binding in ASP.NET MVC.)
Model Binding (What's New whitepaper)
Model Binding Part 1: Selecting Data (blog entry)
Model Binding Part 2: Filtering Data (blog entry)
Model Binding Part 3: Updating Data and Validation (blog entry)
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 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 so that the control does not have to retrieve all rows from the data source each time a new page is displayed.
AllowCustomPaging (MSDN Library)
VirtualItemCount (MSDN Library)
For more information, see What’s New in ASP.NET 4.5 and Visual Studio 11 Developer on the website.
The following products are not included in Visual Studio 11 Beta, but they are available separately as free downloads.

ASP.NET MVC 4.0 Beta

Separate versions of the ASP.NET MVC 4.0 Beta are available for Visual Studio 2010 and Visual Studio 2011 Beta at ASP.NET MVC 4 Beta.
For information about new features in this release, see the following links on the website:

ASP.NET Web Pages 2.0 Beta

The ASP.NET Web Pages 2 Beta can be downloaded as part of the WebMatrix 2 Beta by using the Microsoft Web Platform Installer.
The following table lists enhancements for ASP.NET Web Pages that are included in the Web Pages 2 Beta.
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 into your site using Facebook, Twitter, and Windows Live. The Web Pages 1 site templates have also been upgraded to run on Web Pages 2.
Using the New and Updated Site Templates ( 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.
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 using just a few lines of code.
Validating User Input ( website)
Script management for complex scripts
The Asset Manager manages script processing to prevent the same script (perhaps from multiple pages) from being loaded multiple times and to make sure that scripts are loaded at the appropriate point in the page life cycle.
Registering Scripts Using the Asset Manager ( website)
Side-by-side support
You can run existing Web Pages 1 applications and new Web Pages 2 applications on the same computer.
Running Web Pages Applications Side-by-Side ( 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.
Enabling Logins from Facebook and Other Sites Using OAuth and OpenID ( 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.
Adding Maps Using the Maps Helper ( website)
Mobile display modes
A new Display Modes feature lets you create device-specific pages that are rendered automatically based on the device that makes the request, such as a mobile device.
Rendering Pages for Mobile Devices ( website)
For more information about the ASP.NET Web Pages 2 Beta release, see The Top Features in Web Pages 2 Beta on the website.
The following sections provide information about editor enhancements and new features in the Microsoft Visual Studio 2010 release.
Note Note
The HTML5 and CSS3 features included in the Web Standards Update for Microsoft Visual Studio 2010 SP1 release are also in the Visual Studio 11 Beta.
The following features in the web page designer are either new or have been enhanced for the Microsoft Visual Studio 2010 release.

Multi-browser Support

Installed browsers appear in a new drop-down list next to the Start Debugging button in Visual Studio. This lets you test the same page, application, or site in a variety of browsers.

Page Inspector

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 and lets you examine both the source code and the resulting output. For ASP.NET pages, Page Inspector lets you 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 11 Beta installed on your computer.
  • .NET Framework 4.5 Beta installed on your computer.
  • A Web application that targets the .NET Framework 4 or later.
Note Note
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, and in Solution Explorer the corresponding file is 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 and selects the complete rule. This 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 make a change to the page source, an update bar appears at the top of the viewer that 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.

HTML Editor

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 those that are appropriate. In addition, 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)
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 automatically 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 boilerplate 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 between the tags and 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 (blog entry)
HTML Editor Smart Tasks and Event Handler Generation (video)
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 page's 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 11 Developer on the website.

CSS Editor

The most significant change in the Visual Studio 11 Beta 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 11 Beta.
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 those that are appropriate. In addition, 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 any CSS property that takes a color value, a color picker is displayed that can insert the color's value 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)

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

JavaScript Editor

The JavaScript editor in Visual Studio 11 Beta offers the following enhancements:
  • Support for ECMAScript5.
  • Numerous IntelliSense improvements.
  • Braces matching.
  • A "Go to Definition" feature that jumps from a variable or function name to its definition when you choose the F12 key.
For more information, see JavaScript Editor on the website.
The following table lists some of the data-related changes that have been made in Visual Studio 11 Beta. For data-related enhancements that pertain to Web Forms, see the ASP.NET Web Forms section in this document.
SQL Server Express LocalDB as the default database
SQL Server Express LocalDB replaces SQL Server Express as the default database engine for development. SQL Server Express LocalDB is a lightweight version of SQL Server that has many of the programmability features of a SQL Server database.
Local Data Overview (MSDN Library)
SQL Server Object Explorer
A new SQL Server Object Explorer in Visual Studio lets you manage database objects in a way similar to SQL Server Management Studio. You can open the SQL Server Object Explorer from the View menu in Visual Studio.
Connected Database Development (MSDN Library)
Table Designer
A new Table Designer allows you to define a table by using a graphical designer, a script, or both. The script updates automatically as you change the table design in the graphical designer.
How to: Create Database Objects Using Table Designer (MSDN Library)
New DataAnnotations attributes
New attributes in the System.ComponentModel.DataAnnotations namespace automate validation for common data types such as email addresses, telephone numbers, and credit card numbers. Selected new attributes are listed in the Resources column.
CreditCardAttribute (MSDN Library)
EmailAddressAttribute (MSDN Library)
FileExtensionsAttribute (MSDN Library)
MaxLengthAttribute (MSDN Library)
MinLengthAttribute (MSDN Library)
PhoneAttribute (MSDN Library)
UrlAttribute (MSDN Library)
The Entity Framework and ASP.NET – Getting Started Part 8 ( website)
Performing Validations (article)
Unobtrusive JavaScript for client-side validation
You can now configure DynamicField controls to generate unobtrusive JavaScript for client-side validation.
Unobtrusive Validation (What's New whitepaper)
Entity Data Models and new options for database projects
An Entity Data Model (.edmx) file can now be associated with a database project. In addition to the Generate from Database and Empty Model choices that are available in Visual Studio 2010, the choices in Visual Studio 11 Beta now include Database Model and Database project.
Entity Framework Project & Database Project Integration (MSDN Library)
For more information, see What's New for Data Application Development in Visual Studio 11 Beta.
Visual Studio 11 Beta lets you work with projects that use different versions of the .NET Framework or different versions of Visual Studio.

Enhancements to ASP.NET Multi-Targeting

ASP.NET 4.5 Beta updates the multi-targeting feature with improved filtering for features that are not available in the target version of the .NET Framework.
For more information about multi-targeting, see the following topics:

Working with ASP.NET Applications in Either Visual Studio 2010 or Visual Studio 2011

You can open and work with Visual Studio 2010 projects in Visual Studio 11 Beta and vice-versa, without converting the project to a different format. (This feature is sometimes referred to as round-tripping.)
In Visual Studio 11 Beta, IIS Express replaces the ASP.NET Development Server as the default web server for testing within Visual Studio. (In Visual Studio 2010 SP1, IIS Express was available as an option that you had to explicitly configure as the test web server.) IIS Express is a lightweight, self-contained version of IIS that has been optimized for developers. It has all the core capabilities of IIS as well as additional features designed to ease website development including the following:
  • It does not run as a service or require administrator user rights in order to perform most tasks.
  • IIS Express works well with ASP.NET and PHP applications.
  • Multiple users of IIS Express can work independently on the same computer.
For more information, see IIS Express Overview.
The following links provide more information and resources that you will help you learn about new features in ASP.NET 4.5 Beta and Visual Studio 11 Beta.
Post a Comment