SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Jun 2001
    Location
    Phoenix AZ
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Auto-Redirect to a parent frame

    I am attempting to load a page into a parent frame depending on the outcome of a database query. I am using VBScript / HTML

    Basically the logic is as follows:

    1. Uname / pwd entered.
    2. checked against DBase.
    3. If OK, load new page into parent frame, otherwise display error string in the current frame.

    I was using the response.redirect script once validated, but I can't specify a target frame with this call.

    I thought of creating a dummy page that does an auto-redirect, but the only place I have seen for a target spec (HREF) has no way of automatically triggering.

    Am I pushing the proverbial uphill or is there something else I can do?

  2. #2
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    So if you were going to do response.redirect 'build based on db query...

    Why not do...

    response.write "<script language=""javascript"">parent.framename.location.href=""" & locationToRedirectTo & """</script>"

    ?
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  3. #3
    SitePoint Member
    Join Date
    Jun 2001
    Location
    Phoenix AZ
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the quick response, but that does not allow me to specify a target frame on the redirect.

    The easiest solution would be if I was able to specify a target of _parent in the response.redirect call on the server side.

    But in all my travels I have not seen anything that allows you to redirect with a TARGET spec.

    I am going to change the logic of the site so that I don't have to do it this way. But it would be nice to know if it is possible.

  4. #4
    SitePoint Member
    Join Date
    Jun 2001
    Location
    Phoenix AZ
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Strike that last post, I just re-read it and you have given me the answer, thanks studiococo.

  5. #5
    SitePoint Member
    Join Date
    Jun 2001
    Location
    Phoenix AZ
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Access Denied

    I have implemented the code as suggested, and I get an access denied when I attempt to reference the parent frame.

    The page is structured with content from multiple web servers.
    My script is attempting to redirect to the parent frame that is currently displaying content from a completely different server.

    Also, the parent frame site does not allow anonymous access. A username password is required when the page first loads. Could this be my problem?

  6. #6
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    More than likely...

    parent.framename.location.href="username : password@mysite.com/help.html";

    That's how you pass usernames/passwords in many cases, unless the server is rock tight or using challenge response.
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  7. #7
    SitePoint Member
    Join Date
    Jun 2001
    Location
    Phoenix AZ
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thbaks for the info, I'll let you know how it goes.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •