viewstate - help!

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
 
S

Scott Allen

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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top