What's New in ASP.NET 4.0 ?


ASP.Net 4.0 has improved with so many new features with Output Caching and session storage, auto start web application. Here are some..
1.       Web.Config: .Net Framework 4.0 has improved with web.config file.  The web.config that stores all the configuration information about the application. In Net Framework 4.0 the major configuration setting has been shifted to Maching.config file, you have to mention only few lines in web.config i.e.  Version of target framework for that application.
2.       Output Caching: improvement in output cache in ASP.NET 4 lets you design more aggressive and more intelligent output-caching strategies for Web sites. For example, you can create an output-cache provider that caches the "Top 5" pages of a site in memory, while caching pages that get very less traffic on disk. Alternatively, you can cache every vary-by combination for a rendered page, but use a distributed cache so that the memory consumption is offloaded from front-end Web servers.
3.       Auto Start Web Application: In previous version of framework we have faced the issue of loading the page having large amount of data, to resolve this kind of issue we use some code during the Application_Load method in the Global.asax file. Now in Framework 4.0 and IIS 7.5 we have a new auto start features on windows server 2008 R2. This feature provides a controlled approach for starting up an application pool, initializing an ASP.net application and then accessing HTTP requests.
4.       Permanently redirecting a Page: In ASP.Net, we have traditionally handled requests to old URLs by using the Redirect method to forward a request to the new URL. Although Redirect method issues and HTTP 302 response which is use for temporary redirect. New feature in ASP.Net 4.0 adds a RedirectPermanent response moved permanently. E.g.  RedirectPermanent ("/newpath/myPage.aspx");. And this is very useful for our search engine to get permanent redirects will store the new address.
5.       Session State Compression:  ASP.NET 4 introduces a new compression option for both kinds of out-of-process session state providers. By using this option, applications that have spare CPU cycles on Web servers can achieve substantial reductions in the size of serialized session state data.
6.       Expanding  the range of allowable URLs: ASP.NET 4.0 introduces new options for expanding the size of application URLs. Previous versions of ASP.NET constrained URL path lengths to 260 characters, based on the NTFS file-path limit. In ASP.NET 4, you have the option to increase (or decrease) this limit as appropriate for your applications, using two new attributes of the httpRuntime configuration element. The following example shows these new attributes. E.g.                     maxRequestPathLenght=”260” maxQueryStringLength=”2048”/>
7.       JQuery is already included with the webForms: In .Net framework 4.0 JQuery is already include with form template.
8.       Browser Capabilities:  in ASP.Net 4.0 the new browser capabilities.
9.       ListView Control Enhancement: The ListView control, which was introduced earlies in .NET framework 3.5, has all the functionality of the GridView control while giving you complete control over the output. This control has been made easier to use in ASP.NET 4. The earlier version of the control required that you specify a layout template that contained a server control with a known ID. The following markup shows a typical example of how to use the ListView control in .NET 3.5.

Comments