views:

341

answers:

1

I have a weird performance issue with my ModalExtender using MS Ajax Toolkit, when I postback back to show the modal it takes near 10 seconds for it appear when my Gridview has about 1600 rows. If I page my Gridview to about 10 rows per page, the performance is acceptable, about a second to show..

Is this behavior normal? The speed is being affected by the amount of data displayed on my page.. Has anyone experienced this, if so what was your solution?

::edit:: When I postback I'm not rebinding to the gridview.

+1  A: 

I'm willing to bet that the problem is that your GridView, with 1600 rows, is posting back a large ViewState. Check the size of the ViewState in your page source.

You can also use Fiddler (an HTTP proxy) to check the amount and content of data returned to the server.

Bob Mc
The ViewState is the same size in showing 1600 rows and paging the gridview.
Jreeter
Really? It's a little surprising that the ViewState is the same size whether 1600 or 10 rows are displayed. Is the following scenario correct:- Open page, show gridview with results paged to 10 rows;- Using on-page control, change results to "All", displaying 1600 rows via AJAX callback.If this is correct, you're probably seeing the original ViewState every time you "View Source". Try using Fiddler (see my original answer) to see what is passed back and forth via each AJAX callback.
Bob Mc
Well you are right! The amount of data coming backing is 2mb's, compared to a paged view that returns 62kb...
Jreeter
The reason I was pretty sure about it is because I did the same thing, once upon a time.There are a variety of ways to reduce the size of your ViewState, a subject that is probably covered well in various blogs, as well as on this site.One thing you can look into is persisting your page ViewState to the Session server by using the SessionPageStatePersister class. Check http://msdn.microsoft.com/en-us/library/system.web.ui.sessionpagestatepersister.aspx for more information. Hope this helps.
Bob Mc
So, JReeter, did this correct your problem?
Bob Mc
Bob, this helped, sorry for making you wait for your answer vote :)
Jreeter