New Features in ASP.NET 4.0
Leverage the new features in ASP.NET 4.0 to build scalable, robust, high-performance web applications
October 30, 2009
aspFeature
New Features in ASP.NET 4.0
Leverage the new features in ASP.NET 4.0 to build scalable,robust, high-performance web applications
By Joydip Kanjilal
Microsoft's ASP.NET is one of the most successfulweb application development frameworks ever. Over the years, it has matured tobecome one of the best frameworks for developing highly scalable, high-performanceweb applications in a managed environment. ASP.NET 4.0, shipped as part ofVisual Studio 2010, contains many new and interesting features. This article reviewsthese new features and enhancements in ASP.NET 4.0.
Prerequisites
To work with ASP.NET 4.0, you should have the followinginstalled in your system:
Visual Studio 2010 Beta 1 or later
.NET Framework 4.0 (this actually ships as part ofVisual Studio 2010)
Visual Studio 2010 is scheduled to be released inthe first half of 2010. As of this writing, Visual Studio 2010 Beta 1 isavailable for a free download. You can download VisualStudio 2010 and .NET Framework 4 Beta 1 here.
What's New
Microsoft has added many new and enhanced features toASP.NET in version 4.0. Here's a summary of the most important new features.
Enhanced State Management Features
ASP.NET 4.0 includes improved state managementfeatures. You now have much better control of ViewState by using theViewStateMode property, which gives you better control of your ViewState. Thisproperty can have one of the three values: Enabled, Disabled, or Inherit.
Another new property is ClientIDMode, which you useto set the ClientID for Server Controls and using it from the client side. TheClientIDMode property can have one of the four values: Static, Predictable,Legacy, or Inherit. This property comes in handy, especially in situationswhere your control is embedded inside a parent control.
Performance Monitoring
ASP.NET 4.0 enables you to monitor resourcefunctionality being used by the CLR. To do this, you need to use the followingconfiguration in the aspnet.config file:
Enhancements to ListView Control
The LayoutTemplate for the ListView control has beenmade optional in ASP.NET 4.0. You can just use the ItemTemplate to display yourdata.
ClientIDMode="Predictable"> Customer Code:
Customer Name:
Extensible Output Caching
Output caching is a feature in ASP.NET that lets you cachethe output of pages in memory so that subsequent requests to the same page canbe fetched from the cache. This improves the application's performance to aconsiderable extent, particularly for web pages that contain relatively staledata. Extensible output caching can be used to add extensibility points tooutput caching and configure one or more custom output-cache providers. The cacheAPI in ASP.NET 4.0 allows you to use the following cache storages:
disk-based output caches
custom object caches
distributed object caches
cloud-based object caches
Here is how you can configure your custom outputcache provider in the web.config file:
type="aspNETPRO.OutputCacheEx.DiskOutputCacheProvider,DiskCacheProvider"/> Search Engine OptimizationWebForm Routing enables you to access Web Forms withuser-friendly and descriptive URLs for better search engine optimization (SEO).Note that the System.Web.Routing namespace provides support for routing throughthe RouteTable and PageRouteHandler classes. You can also achieve better SEO byusing the Page Meta Keyword and Description feature in ASP.NET 4.0. Here's anexample of how to use Page Meta Keyword and Descriptions programmatically:protected void Page_Load(object sender, EventArgs e) { this.Page.Title = "JoydipKanjilal's Technology Corner"; this.Page.MetaKeywords = "MVP"; this.Page.MetaDescription = "My Blog"; }More ASP.NET 4.0 ResourcesFollowing are a few links for further references onthis topic. I also cover ASP.NET 4.0 features in more depth in my latest book, ASP.NET4.0 Programming (McGraw-Hill Osborne Media), to be published later thisyear.ASP.NET 4.0 and VisualStudio 2010 Web Development Beta 2 OverviewStephenWalther - New Features of ASP.NET 4.0Overviewof .NET 4.0 features ASP.NET 4.0 ClientIDModeNewFeatures in ASP.Net 4.0 - PART 1NewFeatures in ASP.Net 4.0 - PART 2 Joydip Kanjilal ([email protected]) is aMicrosoft MVP in ASP.NET. He has more than 12 years of industry experience inIT with more than six years in Microsoft .NET and its related technologies.
About the Author
You May Also Like