Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display Information from one page to another

Status
Not open for further replies.

ajap99

Programmer
Dec 9, 2004
18
GB
If I have a text value on one page
How can I display this text value on the next page that I go to
 
Pass it through as:

1) An entry in Request.Querystring
2) An entry in Request.Form
3) A Session Variable

Depending on security issues, I would use 1 or 3.

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
If I use 1) Request.Querystring

What code needs to go on each page
 
You just pass it through with a question mark e.g.
On click of a button:
Code:
Response.Redirect("Page2.aspx?ID=" & Textbox1.Text)

and on Page2 access it via:
Code:
Dim strID as String = Request.Querystring("ID")

I would suggest reading up on the various options you have as these are the very basics of ASP.NET and it will mean more to you if you learn why and how they are used as opposed to one of us just telling you how to do it.



----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
How would you display this then on page 2

(I know I have to read up on the basics)
 
here's a super down and dirty way to do it...

on page1.aspx:
Code:
<a href=page2.aspx?page=1>page two</a>
then on page2.aspx:
Code:
dim pagenum as string
pagenum = request.querystring("page")
response.write(pagenum)
this should display the number 1.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top