ViewState is only used on a single page that handles postbacks. Once you
redirect to the new page, the ViewState is lost. The reason for this is that
ViewState is actually stored in a hidden input field on the HTML form. Thus,
every time the page is posted back, ASP.Net reconstructs the ViewState
object from the hidden input field. However, the new page that you redirect
to does not have this context.
If you need to get the value to the next page, you should either use a
cookie, or the session object.
Ben Lucas
Lead Developer
Solien Technology, Inc.
"Paul" <Pa**@discussions.microsoft.com> wrote in message
news:F9**********************************@microsof t.com...
Hi I am setting a boolean value to true on a page and writing the results
to viewstate Just above the web form designer generated code I have
Dim bps_found As Boolean 'visible to this module
in a button click event I have
bps_found=true
ViewState("ps_found") = bps_found 'save value in viewstate
then a redirect to another page, passing string information.
in the page load I have
bps_found = ViewState("ps_found") 'get value from viewstate
I put a break point in the page load and noticed after the click event
when renavigating to the page the value always stays false, when it should be
true. Thanks
--
Paul G
Software engineer.