Here's a reasonably simple solution.
(VB.NET code)
'Add data to the context object before transferring
Context.Items("myParameter") = x
Server.Transfer("WebForm2.aspx")
Then, in WebForm2.aspx:
'Grab data from the context property
Dim x as Integer = CType(Context.Items("myParameter"),Integer)
Alternately, here's a technique for referencing the previous page more
directly:
http://authors.aspalliance.com/kenc/passval.aspx
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Random" <ci*******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I would like to do a Server.Transfer from a page where I have a peice of
information saved in ViewState. I have a second peice of information that
is in the Forms collection from a form submit. I perform the
Server.Transfer with the option to keep the forms collection available on
the next page.
I get to the new page, however, and the ViewState is empty and the
submitted value is gone. I really don't want to put my information in the
QueryString or do a Response.Redirect. What am I doing wrong?