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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing paramaters to another asp page 1

Status
Not open for further replies.

harpconn

Technical User
Jul 15, 2002
15
0
0
US
There is obviously something basic I don't understand. I need to pass a variable containing a comma delimited string to another asp page for further processing and output. Here's some simplified code that doesn't work. What have I gotten confused about? Nothing is being passed to the browser address line. If I use ISBNlist (without the <%= %> it simply passes the literal string &quot;ISBNlist&quot;. I need to pass the contents of the variable.

FIRST PAGE
--------------
<%@Language=VBscript%>
<%Option Explicit%>

<html>

<head>
<title>TempTest</title>
</head>

<body>
' hyperlink to involk the second page -
[<a href=&quot;ISBN List Details</a>]
<hr>

<%

Dim ISBNlist

ISBNlist=&quot;1400031354,1234567890&quot;
ISBNlist = Server.URLEncode(ISBNlist)

%>
</body>

</html>

SECOND PAGE
-----------
<%@Language=VBscript%>
<%Option Explicit%>
<%Server.ScriptTimeout = 360 %>

<html>

<head>
<title>TempTest</title>
</head>

<body>
<%
'--------------------------------------------------------
' DECLARE VARIABLES
'--------------------------------------------------------

Dim ISBNlist

'--------------------------------------------------------
' GET THE PASSED PARAMATERS
' ISBNList: required (a comma delimited list of ISBN numbers)
'--------------------------------------------------------

ISBNlist=request(&quot;ISBNlist&quot;)
response.write &quot;ISBNlist = &quot; & ISBNlist & &quot;<BR>&quot;

%>
</body>
</html>
 
Hi, shouldn't that line be:
Code:
ISBNlist=Request.QueryString.Item(&quot;ISBNlist&quot;)
Maybe they are the same, but I always use this method..

[profile]
 
Where are you requesting these ISBN numbers from? If they are coming form a submitted form it needs to be request.form(&quot;ISBNlist&quot;)

If they are being passed through the address line it needs to be
Dim 1stISBN
Dim 2ndISBN
1stISBN = &quot;whatever number 1&quot;
2ndISBN = &quot;whatever number 2&quot;
http:\\
Maybe a few more details on what you are trying to do will help.
 
Thanks for quick responses.

Unfortunately,
I get same results with Request.Querystring.Item

Data is not coming from a form. It is generated by the program's processing.
 
ASP will process from the top of the page to the bottom in order. On your first page, you output the link with the variable before you assign any value to it! Just change that round and it should work:

Code:
<%
Dim ISBNlist
ISBNlist=&quot;1400031354,1234567890&quot;
ISBNlist = Server.URLEncode(ISBNlist)
%>

<a href=&quot;[URL unfurl="true"]http://www.wildmind.net/~wildmindbooks/temptest2.asp?ISBNlist=<%=ISBNlist%>&quot;>Show[/URL] ISBN List Details</a>
--James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top