Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Passing a variable to another page

Reply
Thread Tools

Passing a variable to another page

 
 
Ricardo
Guest
Posts: n/a
 
      02-08-2005
How can I navigate to another page via a button, and pass a variable to this
next page...

How can I do this via that method that I see in other sites that the url
goes like this:

http://www.google.com.br/search?hl=pt-BR


[]s...


 
Reply With Quote
 
 
 
 
John Timney \(ASP.NET MVP\)
Guest
Posts: n/a
 
      02-08-2005
Look up the concept of querystrings

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"Ricardo" <> wrote in message
news:%...
> How can I navigate to another page via a button, and pass a variable to

this
> next page...
>
> How can I do this via that method that I see in other sites that the url
> goes like this:
>
> http://www.google.com.br/search?hl=pt-BR
>
>
> []s...
>
>



 
Reply With Quote
 
 
 
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      02-09-2005
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


"Ricardo" <> wrote in message
news:%...
> How can I navigate to another page via a button, and pass a variable to
> this
> next page...
>
> How can I do this via that method that I see in other sites that the url
> goes like this:
>
> http://www.google.com.br/search?hl=pt-BR
>
>
> []s...
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing variable between asp login page and the redirected page Steve ASP .Net 2 11-01-2007 11:32 AM
passing data from a page to another page that's open by the browser? coli@rocketmail.com ASP .Net 1 11-05-2004 02:05 AM
Passing information back to ASP page from another page J P Singh ASP General 2 01-28-2004 04:30 PM
Passing a JavaScript variable/object reference from one page to another?... Davide Bruzzone Javascript 2 08-04-2003 03:32 PM
Passing value from one script on one page to another script on another page. Robert Cohen ASP General 3 07-15-2003 01:46 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57