viewstate - help!

  • Thread starter Thread starter Dave Bartlett
  • Start date Start date
D

Dave Bartlett

I've been wondering for a while if I can safely turn off viewstate on a
datagrid.

I read the following article:
http://msdn.microsoft.com/asp.net/u...pull=/library/en-us/dnaspp/html/viewstate.asp

but ended up more confused than before I read it.

We have a (fairly large) datagrid with editable cells - user edits cells
then submits changes.

Do I need viewstate enabled on the datagrid, basically doubling the HTML
size?

If not how do I deactivate it? (tried setting enableviewstate
property=false, but still see lots of viewstate stuff in HTML output)

Thanks
 
Hi Dave:

It does not sound as if you need viewstate for your datagrid, but I
can't say 100% without seeing the code. Remember though: without
viewstate the DataGrid will need to have DataBind invoked on each trip
to the server.

To see the size of the viewstate each control generates, enable
tracing for the page ( Trace="true" in the @Page directive) and then
view the page. The viewstate size can be found in the Control Tree
section of the trace.

HTH,
 
Back
Top