Speed up your page loads with a lighter ViewState

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 🙂

 

.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s