views:

319

answers:

2

An ex-colleague developed an application that was pretty much an editable grid (think timesheet).

MS Ajax was used for it and the grid was wrapped in an Update panel.

To make things worse the complex object graph was being saved to viewstate so every time the page refreshed i.e. a cell was updated, all the grid and viewstate would get passed from the client to the server in the postback and with a viewstate size of nearly a meg performance is pants.

From my understanding of Ajax we should only be passing about minimal amounts of data and only what is needed. This would require a rewrite and would be costly. What other alternatives are there?

Thanks, B

+1  A: 

Ideally data grids must be used with ViewsState disabled. That would mean binding the grid on every postback.

ControlState is used instead of ViewState when it is absolutely necessary to preserve state of any control. You can read more about ControlState here.

EDIT: Also, there are many light-weight ajax-y datagrids available out there. Flexigrid is one of them. It is a jQuery implementation.

Kirtan
A: 

Thanks for the reply. A rewrite is on the cards but we need to patch up the application in the meantime to keep the client happy and buy us time to rewrite it.

I need a list of quick fixes, one that I will be investigating will be storing the ViewState in a SQL database.

Thanks, B

Burt