Object doesn't support this property or method: 'Response.Redirect

Discussion in 'ASP General' started by Peter D, Jul 8, 2005.

  1. Peter D

    Peter D Guest

    I wanted to add this method to my .asp page in order to dynamically choose a
    page based upon some selection criteria. It's in my .asp book and in the
    online reference. Yet when I use this object, the following error returns
    in the browser:

    Error Type:
    Microsoft VBScript runtime (0x800A01B6)
    Object doesn't support this property or method: 'Response.Redirect'
    /testwebs/choose.asp, line 22

    What is missing from my IIS libraries in order to use have this method
    supported?

    Thanks for any info

    /peter d.
     
    Peter D, Jul 8, 2005
    #1
    1. Advertising

  2. Peter D

    McKirahan Guest

    "Peter D" <> wrote in message
    news:...
    > I wanted to add this method to my .asp page in order to dynamically choose

    a
    > page based upon some selection criteria. It's in my .asp book and in the
    > online reference. Yet when I use this object, the following error

    returns
    > in the browser:
    >
    > Error Type:
    > Microsoft VBScript runtime (0x800A01B6)
    > Object doesn't support this property or method: 'Response.Redirect'
    > /testwebs/choose.asp, line 22
    >
    > What is missing from my IIS libraries in order to use have this method
    > supported?
    >
    > Thanks for any info
    >
    > /peter d.
    >


    What follows "Response.Redirect "?

    If it's a variable then what is it's value?
     
    McKirahan, Jul 8, 2005
    #2
    1. Advertising

  3. Peter D

    Peter D Guest

    Re: Object doesn't support this property or method: 'Response.Redi

    Here it is:

    <%
    dim strUrlName, strUrlValue
    strUrlValue = Request.Form("pickUrl")
    strUrlName = Left(strUrlValue,8)
    if strUrlName = "" then
    Response.Redirect = "index.asp"
    else
    Response.Redirect = "<%strUrlName>"
    end if %>

    PickUrl is a form in a previous page (index.asp) that is a select-list.
    Based upon that selection, I want to url to the selected page. The value in
    strUrlName is the 'page.asp' name, which shows in the post data just fine.
    Neither works because for some reason the server thinks the method of that
    reponse object is not valid ?

    regards, Peter D.

    ------------------
    "McKirahan" wrote:

    > "Peter D" <> wrote in message
    > news:...
    > > I wanted to add this method to my .asp page in order to dynamically choose

    > a
    > > page based upon some selection criteria. It's in my .asp book and in the
    > > online reference. Yet when I use this object, the following error

    > returns
    > > in the browser:
    > >
    > > Error Type:
    > > Microsoft VBScript runtime (0x800A01B6)
    > > Object doesn't support this property or method: 'Response.Redirect'
    > > /testwebs/choose.asp, line 22
    > >
    > > What is missing from my IIS libraries in order to use have this method
    > > supported?
    > >
    > > Thanks for any info
    > >
    > > /peter d.
    > >

    >
    > What follows "Response.Redirect "?
    >
    > If it's a variable then what is it's value?
    >
    >
    >
     
    Peter D, Jul 8, 2005
    #3
  4. Peter D

    diablo Guest

    Re: Object doesn't support this property or method: 'Response.Redi


    > <%
    > dim strUrlName, strUrlValue
    > strUrlValue = Request.Form("pickUrl")
    > strUrlName = Left(strUrlValue,8)
    > if strUrlName = "" then
    > Response.Redirect = "index.asp"
    > else
    > Response.Redirect = "<%strUrlName>"
    > end if %>
    >


    From the above code

    > Response.Redirect = "index.asp"
    > Response.Redirect = "<%strUrlName>"



    are incorrect. it should be

    Response.Redirect "index.asp"
    Response.Redirect strUrlName


    Response.Redirect is a function/method call not a variable assignment.
     
    diablo, Jul 8, 2005
    #4
  5. Peter D

    Griff Guest

    Re: Object doesn't support this property or method: 'Response.Redi

    "diablo" <> wrote in message
    news:Wgpze.2434$...
    >> Response.Redirect = "<%strUrlName>"



    Shouldn't it be something like:

    <%=strUrlName%>

    ?
     
    Griff, Jul 8, 2005
    #5
  6. Peter D

    Griff Guest

    Re: Object doesn't support this property or method: 'Response.Redi

    Actually, having just re-read it...

    There are two methods for redirecting (one may be IIS specific, I don't
    know).

    One (if you can get it to work is better in my opinion) is to do a server
    redirect. Here, the server redirects from one page to another without
    having to go back to the client's browser with a lengthly round trip.

    The second is the response redirect which goes back to the client's browser
    and effectively says "you really don't want that page, you want this one..."
    I've not tried this, but my guess is that the response redirect will
    required a fully formed URL (http://www.yourdomain.org/page.asp)

    hth

    Griff
     
    Griff, Jul 8, 2005
    #6
  7. Re: Object doesn't support this property or method: 'Response.Redi

    > Shouldn't it be something like:
    >
    > <%=strUrlName%>


    No, did you try that?

    <%
    Response.Redirect "<%=strUrlName%>"
    %>

    Yields

    Microsoft VBScript compilation error '800a0409'
    Unterminated string constant

    You're already inside an ASP block, why would you want to start another?
     
    Aaron Bertrand [SQL Server MVP], Jul 8, 2005
    #7
  8. Peter D

    Griff Guest

    Re: Object doesn't support this property or method: 'Response.Redi

    "Dave Anderson" <> wrote in message
    news:...

    >> One (if you can get it to work is better in my opinion) is to do a
    >> server redirect. Here, the server redirects from one page to another
    >> without having to go back to the client's browser with a lengthly
    >> round trip.

    > 1. You mean SCRIPT, not PAGE.


    Do I? ASP stands for Active Server Page. This is a PAGE that contains
    SCRIPT. I can see one being transferred to a PAGE that contains SCRIPT, but
    how can one be transferred to a SCRIPT that exists within a page? Even if I
    am wrong, I believe PAGE was not a misunderstood term.

    > 2. 302 responses are not lengthy.


    It requires one extra round-trip which may well be perceived as slower by
    the client if they are on a slow modem. Surely it's good practive to avoid
    expensive network round-trips if at all possible?


    > 3. A transfer is not a redirection.


    Technically not, but often provides the same functionality if coded
    properly.

    >> The second is the response redirect which goes back to the client's
    >> browser and effectively says "you really don't want that page, you
    >> want this one..." I've not tried this, but my guess is that the
    >> response redirect will required a fully formed URL

    >
    > Then perhaps you should have tried, or at least read up on it before
    > posting.


    Ah, but whilst I didn't have the time to test it or read up on it before
    posting it I knew that the incomplete answer I had should help point the
    original poster in the correct direction to solving their problem.

    > Dave Anderson


    > Unsolicited commercial email will be read at a cost of $500 per message.
    > Use of this email address implies consent to these terms. Please do not
    > contact me directly or ask me to contact you directly for assistance. If
    > your question is worth asking, it's worth posting.


    Now that paragraph really was worth reading!
     
    Griff, Jul 11, 2005
    #8
  9. Peter D

    McKirahan Guest

    Re: Object doesn't support this property or method: 'Response.Redi

    "Griff" <> wrote in message
    news:#...
    > "Dave Anderson" <> wrote in message
    > news:...
    >
    > >> One (if you can get it to work is better in my opinion) is to do a
    > >> server redirect. Here, the server redirects from one page to another
    > >> without having to go back to the client's browser with a lengthly
    > >> round trip.

    > > 1. You mean SCRIPT, not PAGE.

    >
    > Do I? ASP stands for Active Server Page. This is a PAGE that contains


    [snip]

    It's plural:

    ASP stands for Active Server Pages. ASP is a server-side scripting language
    that allows you to add interactivity to your Web sites.

    -- http://webdesign.about.com/od/asp/
     
    McKirahan, Jul 11, 2005
    #9
  10. Peter D

    Turkbear Guest

    Re: Object doesn't support this property or method: 'Response.Redi

    On Mon, 11 Jul 2005 12:16:08 -0500, "McKirahan" <> wrote:

    >"Griff" <> wrote in message
    >news:#...
    >> "Dave Anderson" <> wrote in message
    >> news:...
    >>
    >> >> One (if you can get it to work is better in my opinion) is to do a
    >> >> server redirect. Here, the server redirects from one page to another
    >> >> without having to go back to the client's browser with a lengthly
    >> >> round trip.
    >> > 1. You mean SCRIPT, not PAGE.

    >>
    >> Do I? ASP stands for Active Server Page. This is a PAGE that contains

    >
    >[snip]
    >
    >It's plural:
    >
    >ASP stands for Active Server Pages. ASP is a server-side scripting language
    >that allows you to add interactivity to your Web sites.
    >
    >-- http://webdesign.about.com/od/asp/
    >


    Sorry, ASP is not a scripting language( in spite of what that page says - that site seems to confuse things between
    scripts and the program that can execute them) , see:
    http://www.w3schools.com/asp/asp_intro.asp)
    , it is a program that runs under IIS.
    Scripts within ASP pages can use JavaScript or VBScript .
     
    Turkbear, Jul 11, 2005
    #10
  11. Re: Object doesn't support this property or method: 'Response.Redi

    Griff wrote:
    >> 2. 302 responses are not lengthy.

    >
    > It requires one extra round-trip which may well be perceived
    > as slower by the client if they are on a slow modem. Surely
    > it's good practive to avoid expensive network round-trips if
    > at all possible?


    302 responses are not expensive. They are very compact, in fact.



    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms. Please do not contact
    me directly or ask me to contact you directly for assistance. If your
    question is worth asking, it's worth posting.
     
    Dave Anderson, Jul 11, 2005
    #11
    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. todd
    Replies:
    3
    Views:
    5,827
  2. Roman
    Replies:
    0
    Views:
    4,038
    Roman
    Jan 4, 2004
  3. zdrakec
    Replies:
    0
    Views:
    579
    zdrakec
    Sep 26, 2007
  4. Joe
    Replies:
    3
    Views:
    558
  5. Sal
    Replies:
    1
    Views:
    684
Loading...

Share This Page