.NET Daily

Microsoft ASP.NET

How to Enable Viewstate and Postback Compression using Telerik

Posted on .

How to Enable Viewstate and Postback Compression using Telerik

Introduction

Large ASP.NET pages have big Viewstate size. I think this is one of the biggest downsizes that ASP.NET has because, if you have a big number of web controls in your page,  the page size will increase exponentially after Postback.

A few days ago I found that Telerik AJAX Controls Library also has the RadCompression module which can enable the compression of the Viewstate and the Postback of a page at website level or at page level quite easy. Also I must say that the results are pretty amazing!

Wanna know how good this tool is? Take a look at the following image:

Viewstate Compression

Viewstate Compression

If you have Telerik license and you want to enable RadCompression on your project, please follow the steps below:

  1. Add the following key to the <httpModules> tag from the web.config file. If you don’t find <httpModules> tag, add it too to the <system.Web> tag:
    
         
    
    
  2. Add to the tag the following key:
    
          
    
    

    If you use .NET Framework 4.0, please remove the runAllManagedModulesForAllRequests property from tag.

  3. Right click on your UI project, then click Add -> Add ASP.NET folder -> App_Browsers.
  4. Right click on App_Browsers folder -> New Item… -> Select Browser File, rename the file and after that click Add.
  5. Make sure that your .browser file looks like this:
    
        
            
                
            
        
    
    

    If you already have a .browser file, just add the tag with refID=”Default”.

    Now you have Viewstate compression enabled! For enabling Postback compression, please continue the tutorial.

  6. For enabling Postback compression, add the following keys to the tag:
    
        

    Also add to the tag the following key:

    
        
    
    

That’s it! You now have Postback and Viewstate compression enabled on your project.

More information about RadCompression module you can find here.

Darius

Darius

Darius Dumitrescu is a creative Senior CMS Consultant with in depth .NET knowledge, focused on Web Development and Architecture Design.

There are no comments.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

View Comments (0) ...
Navigation