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.
Printable View
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.
You can also use the query string.
example:
In the MyNextPage.asp page, you access the variableCode:
<a href=MyNextPage.asp?MyVar = xyz>Next Page</a>
by using:
You can use also use cookies to pass values.Code:<% GetValue = Request.QueryString("MyVar") %>
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.
-huh?Quote:
just mess around with a few HTML tags and you should be good to go when it looks right
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").
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.
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:
Code:<INPUT type=hidden name=txtValueFromA value="<%=Request.Form("txtMyValue")%>">
Thanks monte96. It works :)