Passing values between pages

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

I need to move from page1 to page2 but I also need to pass a string value
between the two. Is there a way to achieve this?

Thanks

Regards
 
This was asked and answered here the other day. Here's a part of the response
from Steve Orr:

http://msdn.microsoft.com/msdnmag/issues/03/04/ASPNETUserState/default.aspx

http://www.aspalliance.com/kenc/passval.aspx

http://www.dotnetjunkies.com/tutorials.aspx?tutorialid=600

http://www.dotnetbips.com/displayarticle.aspx?id=79

Here's one nice, simple way to pass values from one page to another:

'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)
 
Back
Top