Speed up your page loads with a lighter ViewState

ASP.NET Team Blog
16 August 2007

Have you noticed your ASPX pages loading slower? Are you using grids? Many third party grids provide a lot of functionality in one control. However, if the control wasn't designed properly then you'll be paying the performance price. When using such grids, you'll notice your pages load slower and you may start to suspect the web server or database indexes. Or worse, the end-users will notice that the pages with some xyz grid are very slow.

You might be suffering from heavy ViewState, ASPxGridView can help rescue you from slow grid pages that suffer from heavy ViewState.

Heavy what?

What is ViewState? Basically, it's a method to persist state for controls between page requests. Click here for a detailed explanation.

ViewState on a diet

The ASPxGridView was designed to generate as little ViewState as is needed. Resulting in faster web pages for you. There are other solutions to remedy heavy ViewState on your pages but they all involve you having to manually code and/or configure each page. ASPxGridView is a drop-in solution.

Designed differently

The R&D team have implemented a smart state caching engine. This engine stores the difference between the control's initial and current state within the "callback state". This way the entire control hierarchy doesn't need to be recreated for every postback. With the new cache design, there's much less code downloaded to the client. That means every action, every callback, is much faster than other grids.

And it's not just in grids, our new smart caching is included in the ASPxperience Suite of controls.

Need proof?

Want to check the ViewState size for yourself? Here's a simple test you can perform on your pages to find the ViewState size. You can use the following JavaScript code from Dino's excellent article. Simply bind this method to any HTML Button control:

<script language="javascript">
    function ShowViewStateSize()
    {
        var buf = document.forms[0]["__VIEWSTATE"].value;
        alert("View state is " + buf.length + " bytes");
    }
</script>

For comparison, I've set up a small project with the ASPxGridView on one page and a standard MS GridView on another page. You can see the ViewState size for the GridView is 1856 bytes. Not bad, but the GridView doesn't do much besides paging and sorting.

MS GridView:

image

 

Now take a look at the ASPxGridView with the following powerful features enabled:

  • Grouping
  • Filtering
  • Exporting
  • Paging
  • Sorting

With all these features enabled, the ASPxGridView's ViewState is still smaller: 1428 bytes.

ASPxGridView:

image

 

Download ASPxGridView and try it out. And then be sure to let me know how much faster your pages load. I love hearing success stories :)

 

.

Free DevExpress Products - Get Your Copy Today

The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the DevExpress Support Center at your convenience. We'll be happy to follow-up.
No Comments

Please login or register to post comments.