what is the postback information in Viewstate for?

S

sam

When you decode Viewstate, there last root triple is a bunch of control
ids that 'participate in postback'. This is all the information i've
been able to gather on the web. Does anyone know exactly what these
are for? And more importantly, how to get rid of them? Thanks.

-Sam
 
A

Alvin Bruney [MVP - ASP.NET]

that information helps asp.net reconstruct the tree control hierarchy. every
control that participates in viewstate is part of that hierarchy. to get rid
of it, disable viewstate for the page

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc, Amazon.com etc
 
S

sam

Hi there!

Thanks for replying. If i set EnableViewState=False in Default.aspx, I
still get this last root triple (and the first one, which is the
hashcode of the Viewstate). So disabling viewstate won't work.

I am trying to get rid of them becuase they occupy quite a bit of
viewstate, especially in DataGrids with postback links. I think this
*is* the main reason why DataGrids are so hard on Viewstate, although
this is not widely believed.

My leading theory is that these control ids are saved as a kind of
'security check' on the __EVENT_TARGET. The server reconstructs the
control tree on postback (note Viewstate isn't needed for this) and
then looks for the __EVENT_TARGET in the list of viewstated control
ids. If its not there then perhaps someone is trying to hack the
server by forcing a postback event on a control that shouldn't be
postbacked on.

This is my theory anyway. Thank you very much for replying. If you
have any more info please post
 

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

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,265
Latest member
TodLarocca

Latest Threads

Top