467,923 Members | 1,258 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,923 developers. It's quick & easy.

ViewState

Why does my viewstate not seem to have an effect after the first server
roundtrip?
Nov 21 '05 #1
  • viewed: 3043
Share:
3 Replies
because you are not rebuilding it probably.

Viewstate is not automatically persistent across server round trips - it
needs to be generated on each trip to the server.
--
Pete Wright
Author of ADO.NET Novice to Pro for Apress
www.petewright.org

"WhoopDing" <vb@whoopding.com> wrote in message
news:eT**************@TK2MSFTNGP12.phx.gbl...
Why does my viewstate not seem to have an effect after the first server
roundtrip?

Nov 21 '05 #2
This is what happens when I post newsgroup messages first thing in the
morning, but do I ever learn my lesson?? ;)

I was confused.

An aspx is called, viewstate is populated and the page is rendered.
When a postback occurs viewstate is there to be used, and will remain
there until you redirect off the page to a different URL. However, the
confusion on my part is that viewstate will get "lost" or corrupted if
during the postback an object is hyrdated from the viewstate and
changed. That object needs to be put back into viewstate since
viewstate is not a reference to a live object.

My apologies for that

"Pete Wright" <pe**********@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
because you are not rebuilding it probably.

Viewstate is not automatically persistent across server round trips - it
needs to be generated on each trip to the server.
--
Pete Wright
Author of ADO.NET Novice to Pro for Apress
www.petewright.org

"WhoopDing" <vb@whoopding.com> wrote in message
news:eT**************@TK2MSFTNGP12.phx.gbl...
Why does my viewstate not seem to have an effect after the first server
roundtrip?


Nov 21 '05 #3
This is what happens when I post newsgroup messages first thing in the
morning, but do I ever learn my lesson?? ;)

I was confused.

An aspx is called, viewstate is populated and the page is rendered. When a
postback occurs viewstate is there to be used, and will remain there until
you redirect off the page to a different URL. However, the confusion on my
part is that viewstate will get "lost" or corrupted if during the postback
an object is hyrdated from the viewstate and changed. That object needs to
be put back into viewstate since viewstate is not a reference to a live
object.

My apologies for that
"Pete Wright" <pe**********@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
because you are not rebuilding it probably.

Viewstate is not automatically persistent across server round trips - it
needs to be generated on each trip to the server.
--
Pete Wright
Author of ADO.NET Novice to Pro for Apress
www.petewright.org

"WhoopDing" <vb@whoopding.com> wrote in message
news:eT**************@TK2MSFTNGP12.phx.gbl...
Why does my viewstate not seem to have an effect after the first server
roundtrip?


Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by John Kirksey | last post: by
3 posts views Thread by Steve Drake | last post: by
10 posts views Thread by neo | last post: by
7 posts views Thread by et | last post: by
9 posts views Thread by Mark Broadbent | last post: by
6 posts views Thread by hitendra15 | last post: by
6 posts views Thread by paul.hester | last post: by
12 posts views Thread by Nick C | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.