Losing viewstate in custom control

W

William

I have a custom control I derived from the datagrid control and set a
couple of values in viewstate("foo") = "bar" but on postback they are
nothing. I have seen an example of doing this in the O'Reilly book
"Programming asp.net" pg 645. I must be missing something. Any help
would be greatly appreciated.
 
W

William French

I was putting together a simple example to post when I figured out what
I did. I had moved the order of the control in the controls collection
by adding other child controls. I guess viewstate is assigned based on
that order.

I am having another interesting viestate issue know where I can add
somthing to viewstate on the first load of the control but on post back
I cannot update viewstate. Is that how it works. Also I noticed that
when an onclick event fires for another derived control I am using
viewstate isn't available at that point yet. Any ideas? Thanks for
your help.
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top