Adding variables to response.redirect

Discussion in 'ASP General' started by Bill, Aug 26, 2003.

  1. Bill

    Bill Guest

    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
     
    Bill, Aug 26, 2003
    #1
    1. Advertising

  2. Bill

    Bob Barrows Guest

    Bill wrote:
    > 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
     
    Bob Barrows, Aug 26, 2003
    #2
    1. Advertising

  3. Bill

    Ray at Guest

    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


    "Bill" <> wrote in message
    news:...
    > 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
     
    Ray at, Aug 26, 2003
    #3
  4. Check rs("isbn") for leading spaces. If so, either Trim(rs("isbn")) or
    Server.URLEncode(rs("isbn"))

    "Bill" <> wrote in message
    news:...
    > 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
     
    Mark Hastings, Aug 26, 2003
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Charles A. Lackman
    Replies:
    2
    Views:
    8,045
    Charles A. Lackman
    Jan 11, 2006
  2. Matthew Wieder

    Response.Write and Response.Redirect

    Matthew Wieder, Jul 17, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    729
    Kevin Spencer
    Jul 17, 2003
  3. =?Utf-8?B?VHJveQ==?=

    Response.redirect does not redirect from .aspx page

    =?Utf-8?B?VHJveQ==?=, Oct 18, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    5,303
    Srowe1975
    Oct 15, 2008
  4. Sal
    Replies:
    1
    Views:
    819
  5. Ron Howard
    Replies:
    2
    Views:
    544
    Ron Howard
    Aug 11, 2004
Loading...

Share This Page