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

pass variable parm to another asp page

Status
Not open for further replies.

cat5ive

MIS
Dec 3, 2004
184
US
Hi,

I have a variable name "reason" that contain some text.
I'm tring to pass it as a parm to another asp page but it doesn't work. When it go to another asp page, reason show as a text "reason" not the value that it contains. Can someone help? I think my code below is enough to tell what's wrong. If you need more info please let me know.

Thanks in advance

Code:
<%
..
nodataerror = "error.asp?error=nodata&reason=reason"
..
Response.redirect nodataerror
..
%>
 
Code:
<%
..
nodataerror = "error.asp?error=nodata&reason=" & server.URLEncode(strReason)
..
Response.redirect nodataerror
..
%>

Where strReason holds the value you want to pass
 
What is the name of the variable you are storing the text to? And show me your now modified code.
 
I did a debug before Response.redirect nodataerror statement and it show value, PO# has not been assigned to 7501., in strReason
Code:
nodataerror =  "error.asp?error=nodata&reason=" + server.URLEncode(strReason)
..
 if (xmldoc.getElementsByTagName("recordnotavailable").length > 0) then
    dim strReason
    set table = xmldoc.getElementsByTagName("recordnotavailable")
	for i = 0 to table.length - 1
	  strReason = table(i).firstChild.nodeValue + "<br>"
	next
	
	Response.redirect nodataerror
  end if
 
If it's possible to have an error at i=0 and max "i" is larger than 0, then with your current for loop, it's going to overwrite the strReason. May want to change that line to:
strReason = strReason + table(i).firstChild.nodeValue + "<br>"
 
Hi,

I found out what's wrong. It's because I assigned the value to srtReason after this statement.
nodataerror = "error.asp?error=nodata&reason=" + server.URLEncode(strReason)

Thank you very much for your help, Creto
 
Shows what my mental state was at the end of yesterday that I didn't catch that either. Glad you found the problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top