hi there
I have a little web app, that consumes a web service. the main page runs a search - by passing params to a particular ws method, and then i bind the results to a gridview.
I have implimented sorting and paging on the grid, by putting the datatable that the grid is bound to in the viewstate and then reading/sorting / filtering it when necessary - and rebinding to the grid.
recently - as the amount of data coming back from the WS has increased dramatically when i try to page/sort etc i get
The connection was reset
The connection to the server was reset while the page was loading.
having googled around a bit it seems that a very large viewstate is to blame for this. but surely the only other option is to
- Limit the results
- stick the datatable in the session rather than the viewstate
- dunno :)
previously i did have the datatable in the session, as some of this data needed to persist from page to page - (not being posted however so viewstate was not an option), but as the amount of data rose, and the neccessity to persist was removed, i used the viewstate instead. thinking this was a better option that the session anyway mostly because of the amount of data the session would have to hold, and the number of users using the app.
it appears maybe not
i actually thought that when the viewstate got very big, that .net split it over more than one hidden viewstate field, but it seems all im getting is one mamoth one that i have trouble viewing in the source..
can anyone enlighten me as to how to avoid the error im getting.. if it is indeed to do with the amount of data in the viewstate
many thanks
nat