Connecting Tech Pros Worldwide Forums | Help | Site Map

Transfer data between pages

Fernando Lopes
Guest
 
Posts: n/a
#1: Nov 19 '05
Hi there.
There's a way to transfer data between pages but:
- Not using Session
- Not use Querystring

Tks.

Fernando Lopes



darrel
Guest
 
Posts: n/a
#2: Nov 19 '05

re: Transfer data between pages


> There's a way to transfer data between pages but:[color=blue]
> - Not using Session
> - Not use Querystring[/color]

You could write/read to a database and/or text file.

You could use cookies (provided everyone had cookies enabled).

-Darrel


Steve C. Orr [MVP, MCSD]
Guest
 
Posts: n/a
#3: Nov 19 '05

re: Transfer data between pages


Here's a nice, simple way to pass values from one page to another:
(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)

Of course there are a number of ways to pass values from one page to
another, such as using the querystring, cookies, session,
context, saving to a temporary table in the database between each page, etc.
You'll have to decide which technique is best for your application.
Here are several good articles on the subject to help you decide.
http://msdn.microsoft.com/msdnmag/is...e/default.aspx

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

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

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


"Fernando Lopes" <fernandomattarlopes@[remove]msn.com> wrote in message
news:u4NDi$fQFHA.2972@TK2MSFTNGP14.phx.gbl...[color=blue]
> Hi there.
> There's a way to transfer data between pages but:
> - Not using Session
> - Not use Querystring
>
> Tks.
>
> Fernando Lopes
>
>[/color]


Lucas Tam
Guest
 
Posts: n/a
#4: Nov 19 '05

re: Transfer data between pages


"Steve C. Orr [MVP, MCSD]" <Steve@Orr.net> wrote in news:uY7SKSgQFHA.3880
@tk2msftngp13.phx.gbl:
[color=blue]
> Here's a nice, simple way to pass values from one page to another:
> (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)[/color]

Yup, HTTP Context is a great feature : ) It's one of those features that is
a bit undervalued IMHO.

--
Lucas Tam (REMOVEnntp@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Peter Morris [Droopy eyes software]
Guest
 
Posts: n/a
#5: Nov 19 '05

re: Transfer data between pages


You could put it in the Cache with an expiry, you would have to put the
key (A Guid maybe) in the querystring but I doubt that would be a
security issue or anything.


--
Pete
====
ECO Modeler, Audio compression components, DIB graphics controls,
FastStrings
http://www.droopyeyes.com

Read or write articles on just about anything
http://www.HowToDoThings.com

My blog
http://blogs.slcdug.org/petermorris/
Closed Thread