Discussion Locked

Passing variables with ASP??

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,

I'm trying to pass a variable "mailval" from a hyperlink to an ASP file.
Ex:
Test

How should I retrieve the value with the ASP file, through a form hidden object or with a function expecting a variable "mailval" ??

Thank you!

5 replies

by peyison

If you pass the variable this way, you can retrieve the value like this:

<%
MailVal = Request.QueryString("mailval")

%>

Hope this helps.

by ifinallyhaveoptions

When passing variables from one asp page to another, your options are to store the variable:

1. as a session variable
ex:

session("mailval") = 1
'this assigns the value

thisPassedVal =session("mailval")
'this is how you retrieve the session variable

'if you have a server farm, co-located servers, clusters, etc., stay away from session variables

2. as a form variable

mailval = request.form("mailval")

3. in your querystring as you have displayed

someasppage.asp?mailval=1

mailval = request.querystring("mailval")

4. store in a database, and retrieve it from any page

this doesn't seem like a viable option for this type of variable use, however.

Good luck.

This discussion is closed to new replies.