Viewstate enabled and set, but not all data is being stored in thepage

K

Keith Murray

I have a custom web control, similar to a datagrid. The grid can have a
button that the user clicks to select the row. I use a custom button
with a data field that is stored in the Viewstate. So far, this is
working fine.

If I add another button to the row in exactly the same manner, the
Viewstate for that button is not saved. I turned on the Trace for the
page and it shows first button containing 56 bytes of Viewstate, but the
second button shows zero.

I debugged through the creation of the grid. All components have
EnabledViewState = true. I checked the Viewstate bag before the page is
posted and all buttons contained the "ButtonData" object. It appears
that when the page is rendered, the viewstate object is not picking up
the second button.

Is there some tool that can be used to pull the Viewstate string apart?

Thanks,
Keith
 
C

Chris R. Timmons

I have a custom web control, similar to a datagrid. The grid can
have a button that the user clicks to select the row. I use a
custom button with a data field that is stored in the Viewstate.
So far, this is working fine.

If I add another button to the row in exactly the same manner,
the Viewstate for that button is not saved. I turned on the
Trace for the page and it shows first button containing 56 bytes
of Viewstate, but the second button shows zero.

I debugged through the creation of the grid. All components have
EnabledViewState = true. I checked the Viewstate bag before the
page is posted and all buttons contained the "ButtonData"
object. It appears that when the page is rendered, the viewstate
object is not picking up the second button.

Is there some tool that can be used to pull the Viewstate string
apart?

Keith,

Here's an MSDN article w/ code that can be used to parse a view state string:

Understanding ASP.NET View State
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/viewstate.asp
 

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,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top