Gridview and clientcallback

Its no secret that (only) the gridview control have a new property which enables automaticly client callback instead of postback. This works only for sorting and paging.

EnableSortingAndPagingCallbacks="True"

The diffrence is a better UI for the user. But another point is hidden. The amount of traffic.

To measure the traffic, i use fiddler, a great and free http debug proxy from Microsoft. My scenario uses northwind customers and show 10 entrys per page. Task is show page, sort by customerid and sort again by customer id.

Result:

without callback

  • 3 times ~9600 Bytes transfered (per request)

with callback

  • 1st reqest ~13.000 Bytes
  • Webresource ~13.000 Bytes
  • Webresource ~ 1400
  • 2 times (sort) ~7500 Bytes

So you can see Client Callbacks (also Ajax) does not always reduce the amount of traffic. It depends. In our scenario we have ~30K adverse ~42K which is more then 30 % diffrence.

 

 

 

Published Thursday, October 20, 2005 9:53 AM by preishuber

Comments

# re: Gridview and clientcallback

Thursday, October 20, 2005 6:14 AM by Albert Weinert
Ok, Ajax and Client Callbacks need a greate amount of JavaScript which must transfered to the Browser.

But, a normal Webpage surely have some other HTML Mambo Jambo arround the Gridview (or other Controls), and within the "Application Lifetime" it is mostly sure that the Webresources would be only loaded once per session.

And the Gridview is a big Control which much data to be exchanged. With other Controls (e.g. DropDownList) the rate is much better for ClientCallbacks an Ajax. Using ClientCallbacks and Ajax for only one control make no sense.

I think that the greater amount of JavaScript will be ballanced more than out while using the Application more than 30 Seconds :)

# re: Gridview and clientcallback

Thursday, October 20, 2005 7:35 AM by Olli
I hate the comparing of AJAX, Client Script and PostBacks because you can do everything wrong!!!

Have a look at the render engine from Simone at the AJAX Google Group (http://groups.google.com/group/ajaxpro/browse_frm/thread/81a3ad2cb6b31822/7a4246455f10cb2a?q=simone&rnum=4#7a4246455f10cb2a). If you have a look inside you will see that the data that is sent over the net is less then you have when using viewstate. You only have to send the data you want to show.

In the next release Michael is working on he has removed the use of the column names for each row, so he will only return the data, with a separator and maybe with a " at the begining/end.

Also, if I have a look at the AJAX PRO version client scripts are cached, so there are no bytes transfered after first call!!!

I hope Michael can release his next version which will merge his two libs together, have a look on his blog at http://weblogs.asp.net/mschwarz.

# re: Gridview and clientcallback

Thursday, October 20, 2005 7:36 AM by another anon
Well instead of sitting there, blowing wind and hot air about some non-existant virtues of Ajax, why don't do what Hannes has done and prove it wrong, or keep quiet.

# re: Gridview and clientcallback

Wednesday, March 28, 2012 2:08 PM by Kenneth

And how does that mean? I do not understand anything.

Leave a Comment

(required) 
(required) 
(optional)
(required)