Sunday, June 19, 2011

New features in .Net 4.0

1. ASP.NET 4.0 comes with a new option for compressing the Session data with Out Process Session mode(mode=StateServer). To enable this functionality, we need to add “compressionEnabled=”true” attribute with the SessionMode in web.config.
image
When Compression mode is enabled in web.config, ASP.NET compresses the serialized session data and passes it to session storage and while retrieving same deserialization and decompression happens in the server side. ASP.NET 4.0 used System.IO.Compression.GZStream class to compress the session mode.

2. We can programmatically change Session State Behavior when required as below:


 //The Session State behaviour can be any of: Default,Disabled,ReadOnly,Required based on the requirement.

3.
HttpContext.Current.SetSessionStateBehavior( System.Web.SessionState.SessionStateBehavior.Default)

1 comment:

  1. just place the link button easy to view ur posts r add pages

    ReplyDelete