I just want to use server.transfer and still have viewstate

G

Guest

I want to use server.transfer to go to a new aspx page. I want to be able to
still have the viewstate from the previous page. I have researched this and
see a lot about it, but I can't find a good straight forward example. Does
anyone know how to do this? I'm using asp.net 2.0 and vb.net. Thanks.
 
G

Guest

Lanem,
Viewstate is specific to the page it pertains to and is only available when
that page posts back to itselft.

With Server.Transfer, you could look at ways to pass the previous page's
state either in Session, or HttpContext Items collection. In ASP.NET 2.0 you
have cross - page postbacks and the Page class exposes a PreviousPage
property. And, there are other solutions as well, But ViewState isn't one of
them.
Peter
 
G

Guest

I have created some values in the original page like this:
ViewState("theString") = "Hello World".

Can I still reference these values using PreviousPage on the second page? I
know I can get the values of controls that are on the original page, but what
about these kinds of values?

Thanks.
 

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,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top