What’s New in ASP.NET 4 and Visual Web Developer
.NET Framework 4
The .NET Framework version 4 includes enhancements for ASP.NET 4 in targeted areas. Visual Studio 2010 and Microsoft Visual Web Developer Express also include enhancements and new features for improved Web development. This document provides an overview of many of the new features that are included in the upcoming release.
This topic contains the following sections:
- ASP.NET Core Services
- ASP.NET Web Forms
- ASP.NET MVC
- Dynamic Data
- ASP.NET Chart Control
- Visual Web Developer Enhancements
- Web Application Deployment with Visual Studio 2010
- Enhancements to ASP.NET Multi-Targetin
ASP.NET Core Services
ASP.NET 4 introduces many features that improve core ASP.NET services such as output caching and session state storage.
Web.config File Refactoring
The Web.config file that contains configuration information for a Web application has grown considerably over the past few releases of the .NET Framework as new features have been added. In .the .NET Framework 4, the major configuration elements have been moved to the machine.config file, and applications now inherit these settings. This allows the Web.config file in ASP.NET 4 applications to be empty or to specify only which version of the framework the application is targeting, as shown in the following example:
<compilation targetFramework=”4.0″ />
ASP.NET Web Forms
Web Forms has been a core feature in ASP.NET since the release of ASP.NET 1.0. Many enhancements have been in this area for ASP.NET 4, such as the following:
- The ability to set meta tags.
- More control over view state.
- Support for recently introduced browsers and devices.
- Easier ways to work with browser capabilities.
- Support for using ASP.NET routing with Web Forms.
- More control over generated IDs.
- The ability to persist selected rows in data controls.
- More control over rendered HTML in the FormView and ListView controls.
- Filtering support for data source controls.
- Enhanced support for Web standards and accessibility.
- Project template changes.
ASP.NET MVC helps Web developers build compelling standards-based Web sites that are easy to maintain because it decreases the dependency among application layers by using the Model-View-Controller (MVC) pattern. MVC provides complete control over the page markup. It also improves testability by inherently supporting Test Driven Development (TDD).
Web sites created using ASP.NET MVC have a modular architecture. This allows members of a team to work independently on the various modules and can be used to improve collaboration. For example, developers can work on the model and controller layers (data and logic), while the designer work on the view (presentation).
Dynamic Data was introduced in the .NET Framework 3.5 SP1 release in mid-2008. This feature provides many enhancements for creating data-driven applications, such as the following:
- A RAD experience for quickly building a data-driven Web site.
- Automatic validation that is based on constraints defined in the data model.
- The ability to easily change the markup that is generated for fields in the GridView and DetailsView controls by using field templates that are part of your Dynamic Data project.
For ASP.NET 4, Dynamic Data has been enhanced to give developers even more power for quickly building data-driven Web sites.
Enabling Dynamic Data for Individual Data-Bound Controls in Existing Web Applications
You can use Dynamic Data features in existing ASP.NET Web applications that do not use scaffolding by enabling Dynamic Data for individual data-bound controls. Dynamic Data provides the presentation and data layer support for rendering these controls. When you enable Dynamic Data for data-bound controls, you get the following benefits:
- Setting default values for data fields. Dynamic Data enables you to provide default values at run time for fields in a data control.
- Interacting with the database without creating and registering a data model.
- Automatically validating the data that is entered by the user without writing any code.
ASP.NET Chart Control
The ASP.NET chart server control enables you to create ASP.NET pages applications that have simple, intuitive charts for complex statistical or financial analysis. The chart control supports the following features:
- Data series, chart areas, axes, legends, labels, titles, and more.
- Data binding.
- Data manipulation, such as copying, splitting, merging, alignment, grouping, sorting, searching, and filtering.
- Statistical formulas and financial formulas.
- Advanced chart appearance, such as 3-D, anti-aliasing, lighting, and perspective.
- Events and customizations.
- Interactivity and Microsoft Ajax.
- Support for the Ajax Content Delivery Network (CDN), which provides an optimized way for you to add Microsoft Ajax Library and jQuery scripts to your Web applications.
Visual Web Developer Enhancements
The following sections provide information about enhancements and new features in Visual Studio 2010 and Visual Web Developer Express.
The Web page designer in Visual Studio 2010 has been enhanced for better CSS compatibility, includes additional support for HTML and ASP.NET markup snippets, and features a redesigned version of IntelliSense for JScript.
Improved CSS Compatibility
The Visual Web Developer designer in Visual Studio 2010 has been updated to improve CSS 2.1 standards compliance. The designer better preserves HTML source code and is more robust than in previous versions of Visual Studio.
In the HTML editor, IntelliSense auto-completes tag names. The IntelliSense Snippets feature auto-completes whole tags and more. In Visual Studio 2010, IntelliSense snippets are supported for JScript, alongside C# and Visual Basic, which were supported in earlier versions of Visual Studio.
Visual Studio 2010 includes over 200 snippets that help you auto-complete common ASP.NET and HTML tags, including required attributes (such as runat=”server”) and common attributes specific to a tag (such as ID, DataSourceID, ControlToValidate, and Text).
You can download additional snippets, or you can write your own snippets that encapsulate the blocks of markup that you or your team use for common tasks.
Web Application Deployment with Visual Studio 2010
For Web application projects, Visual Studio now provides tools that work with the IIS Web Deployment Tool (Web Deploy) to automate many processes that had to be done manually in earlier versions of ASP.NET. For example, the following tasks can now be automated:
- Creating an IIS application on the destination computer and configuring IIS settings.
- Copying files to the destination computer.
- Changing Web.config settings that must be different in the destination environment.
- Propagating changes to data or data structures in SQL Server databases that are used by the Web application.
ASP.NET 4 adds new features to the multi-targeting feature to make it easier to work with projects that target earlier versions of the .NET Framework.
Multi-targeting was introduced in ASP.NET 3.5 to enable you to use the latest version of Visual Studio without having to upgrade existing Web sites or Web services to the latest version of the .NET Framework.
In Visual Studio 2008, when you work with a project targeted for an earlier version of the .NET Framework, most features of the development environment adapt to the targeted version. However, IntelliSense displays language features that are available in the current version, and property windows display properties available in the current version. In Visual Studio 2010, only language features and properties available in the targeted version of the .NET Framework are shown.