Adding variables to response.redirect

B

Bill

I have a page that contains processed variables that I'd like to
forward using the response.redirect method. However, because the
response.redirect contains the page within "pagename.asp", I have not
been able to pass the variable. I've tried concatenating it, by doing
respone.redirect "pagename.asp?isbn=" & rs("isbn"), however it is not
working and is stopping at the ?isbn=
and not adding the variable value. What can I do to include this, or
is there any other way I can pass the variables when I'm using the
response.redirect method?

Thank you,
Bill
 
B

Bob Barrows

Bill said:
I have a page that contains processed variables that I'd like to
forward using the response.redirect method. However, because the
response.redirect contains the page within "pagename.asp", I have not
been able to pass the variable. I've tried concatenating it, by doing
respone.redirect "pagename.asp?isbn=" & rs("isbn"), however it is not
working and is stopping at the ?isbn=
and not adding the variable value. What can I do to include this, or
is there any other way I can pass the variables when I'm using the
response.redirect method?
Your method has always worked for me. Please define "not working" and show
us the actual code that is "not working". (by "actual" I mean that your
example statement above would not work even if you weren't attempting to
concatenate a parameter to the url <grin> )

Bob Barrows
 
R

Ray at

I'm not sure what isn't working for you. This should work. I personally
always use sRedirect and always redirect to a variable name. Like so:



Dim sRedirect
Select Case [something]
Case [something]
sRedirect = "page1.asp"
Case [somethingElse]
sRedirect = "page2.asp"
Case [AnotherCondition]
sRedirect = "page3.asp?isbn=" & rs.fields.item(0).value
Case Else
sRedirect = "page9.asp"
End Select

Response.Redirect sRedirect

Ray at work
 
M

Mark Hastings

Check rs("isbn") for leading spaces. If so, either Trim(rs("isbn")) or
Server.URLEncode(rs("isbn"))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top