Click to See Complete Forum and Search --> : Value passing
cedx
Oct 9th, 2000, 10:11 AM
Hi,
How can I send a value from one ASP page to another? Currently, I am doing it using the 'get' method in the FORM tags. Is there another way of sending values?
Thanks in advance.
compuGEEK
Oct 9th, 2000, 11:38 AM
You can also use the query string.
example:
<a href=MyNextPage.asp?MyVar = xyz>Next Page</a>
In the MyNextPage.asp page, you access the variable
by using:
<% GetValue = Request.QueryString("MyVar") %>
You can use also use cookies to pass values.
azpc
Oct 9th, 2000, 11:46 AM
I think what he means is that some things just dont show up like they do in IE. I had a problem with this when I did my database for a real estate company, just mess around with a few HTML tags and you should be good to go when it looks right. Hope this helps some.
monte96
Oct 9th, 2000, 06:51 PM
just mess around with a few HTML tags and you should be good to go when it looks right -huh?
What your looking for is method=POST
That will pass the data without displaying it on the URL line. You can access the data on the page receiving the form action by using Request.Form("NameOfInputElement").
cedx
Oct 9th, 2000, 06:59 PM
I actually wanted to collect a value from one page (page A) and use it on two other pages (Page B & C). I used the get method in Page A, and I need the value again together with the new ones I got from Page B in Page C.
I'll try the POST method though. BTW, do I need to put that in a FORM tag as well?
Thanks.
monte96
Oct 9th, 2000, 07:43 PM
The syntax is:
<FORM name=MyForm method=post action=NextPage.asp>
It sounds like you are going to need to either:
a) Pass it to page B and write it into a hidden textbox that will be passed to page C from page B
or
b) Store the value in a Session Object.
Depends on where you need to use it on whether or not you can easily use the session object since it only exists on the server side.
But, you can easily do something like this on page B:
<INPUT type=hidden name=txtValueFromA value="<%=Request.Form("txtMyValue")%>">
cedx
Oct 10th, 2000, 02:50 AM
Thanks monte96. It works :)
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.