|
-
Oct 9th, 2000, 10:11 AM
#1
Thread Starter
Lively Member
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.
-
Oct 9th, 2000, 11:38 AM
#2
Hyperactive Member
You can also use the query string.
example:
Code:
<a href=MyNextPage.asp?MyVar = xyz>Next Page</a>
In the MyNextPage.asp page, you access the variable
by using:
Code:
<% GetValue = Request.QueryString("MyVar") %>
You can use also use cookies to pass values.
-
Oct 9th, 2000, 11:46 AM
#3
New Member
I think what he means is that..
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.
-
Oct 9th, 2000, 06:51 PM
#4
Frenzied Member
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").
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
Oct 9th, 2000, 06:59 PM
#5
Thread Starter
Lively Member
Re: Passing Value
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.
-
Oct 9th, 2000, 07:43 PM
#6
Frenzied Member
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")%>">
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
Oct 10th, 2000, 02:50 AM
#7
Thread Starter
Lively Member
Thanks monte96. It works
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|