Thursday, March 29, 2012

Passing values between pages

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
Regardsquerystring
- Sahil Malik
You can reach me thru my blog at
http://www.dotnetjunkies.com/weblog/sahilmalik
"John" <John@.nospam.infovis.co.uk> wrote in message
news:%23iWf5$WrEHA.3988@.tk2msftngp13.phx.gbl...
> 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 respons
e
from Steve Orr:
http://msdn.microsoft.com/msdnmag/i...te/default.aspx
http://www.aspalliance.com/kenc/passval.aspx
http://www.dotnetjunkies.com/tutori...?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)
"John" wrote:

> 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
>
>
You can use a Session variable.
Xavier Pacheco
Xapware Technologies Inc
manage your projects: www.xapware.com/ActiveFocus.htm
the blog: www.xavierpacheco.com/xlog
the book: www.amazon.com/exec/obidos/ASIN/067...avierpacheco-20
Umm .. be careful when you use Session variables though - sticking
everything under the sun into session variables is not the most desirable
thing to do; from a scaleability point of view.
- Sahil Malik
You can reach me thru my blog at
http://www.dotnetjunkies.com/weblog/sahilmalik
"Xavier Pacheco" <xavier@._nospam_xapware.com> wrote in message
news:xn0do9v4d9ymlpx00f@.msnews.microsoft.com...
> You can use a Session variable.
>
> --
> Xavier Pacheco
> Xapware Technologies Inc
> manage your projects: www.xapware.com/ActiveFocus.htm
> the blog: www.xavierpacheco.com/xlog
> the book: www.amazon.com/exec/obidos/ASIN/067...avierpacheco-20
very true indeed.
Xavier Pacheco
Xapware Technologies Inc
manage your projects: www.xapware.com/ActiveFocus.htm
the blog: www.xavierpacheco.com/xlog
the book: www.amazon.com/exec/obidos/ASIN/067...avierpacheco-20

0 comments:

Post a Comment