Redirect out of a Frameset

Discussion in 'ASP General' started by David GB, Dec 24, 2004.

  1. David GB

    David GB Guest

    If a page runnning in a frame does a redirect, the new page is loaded into
    the same frame.

    How do I do a redirect that 'looses' the frameset?

    In html, you can create a link with "target=_top" and it replaces the entire
    frameset.

    But a reponse.redirect("NewPage.aspx Target=_top") becomes:
    http://server/NewPage.aspx Target=_top

    How do I do this? Can I stop it from parsing the space into %20, or is
    there a different method altogether I should use?

    David
    --
    David Gordon-Brown
     
    David GB, Dec 24, 2004
    #1
    1. Advertising

  2. David GB

    Tim Williams Guest

    You could send back a HTML page with some javascript to load your
    required URL into the top level window.
    Should not mess with the history list.

    <script type="text/javascript">
    top.location.replace( "yourURLHere" );
    </script>


    Tim.


    "David GB" <> wrote in message
    news:...
    > If a page runnning in a frame does a redirect, the new page is
    > loaded into
    > the same frame.
    >
    > How do I do a redirect that 'looses' the frameset?
    >
    > In html, you can create a link with "target=_top" and it replaces
    > the entire
    > frameset.
    >
    > But a reponse.redirect("NewPage.aspx Target=_top") becomes:
    > http://server/NewPage.aspx Target=_top
    >
    > How do I do this? Can I stop it from parsing the space into %20, or
    > is
    > there a different method altogether I should use?
    >
    > David
    > --
    > David Gordon-Brown
     
    Tim Williams, Dec 24, 2004
    #2
    1. Advertising

  3. David GB

    David GB Guest

    Smart idea. Thanks.

    I would put that into the page 'OnLoad' procedure, right?

    Could it trigger pop-up blockers, though?

    "Tim Williams" wrote:

    > You could send back a HTML page with some javascript to load your
    > required URL into the top level window.
    > Should not mess with the history list.
    >
    > <script type="text/javascript">
    > top.location.replace( "yourURLHere" );
    > </script>
    >
    >
    > Tim.
    >
    >
    > "David GB" <> wrote in message
    > news:...
    > > If a page runnning in a frame does a redirect, the new page is
    > > loaded into
    > > the same frame.
    > >
    > > How do I do a redirect that 'looses' the frameset?
    > >
    > > In html, you can create a link with "target=_top" and it replaces
    > > the entire
    > > frameset.
    > >
    > > But a reponse.redirect("NewPage.aspx Target=_top") becomes:
    > > http://server/NewPage.aspx Target=_top
    > >
    > > How do I do this? Can I stop it from parsing the space into %20, or
    > > is
    > > there a different method altogether I should use?
    > >
    > > David
    > > --
    > > David Gordon-Brown

    >
    >
    >
     
    David GB, Dec 27, 2004
    #3
  4. David GB

    Tim Williams Guest

    David,

    If you just put it in the page it will execute without having to be
    called from onload. AFAIK it will not trigger pop-up blockers since
    you are not opening a new window. It will, however, fail if the user
    has js disabled or is not using a js-capable browser, so beware of
    that.

    Tim.


    "David GB" <> wrote in message
    news:...
    > Smart idea. Thanks.
    >
    > I would put that into the page 'OnLoad' procedure, right?
    >
    > Could it trigger pop-up blockers, though?
    >
    > "Tim Williams" wrote:
    >
    >> You could send back a HTML page with some javascript to load your
    >> required URL into the top level window.
    >> Should not mess with the history list.
    >>
    >> <script type="text/javascript">
    >> top.location.replace( "yourURLHere" );
    >> </script>
    >>
    >>
    >> Tim.
    >>
    >>
     
    Tim Williams, Dec 27, 2004
    #4
  5. David GB

    David GB Guest

    Thanks. Very helpful.

    David

    "Tim Williams" wrote:

    > David,
    >
    > If you just put it in the page it will execute without having to be
    > called from onload. AFAIK it will not trigger pop-up blockers since
    > you are not opening a new window. It will, however, fail if the user
    > has js disabled or is not using a js-capable browser, so beware of
    > that.
    >
    > Tim.
    >
    >
    > "David GB" <> wrote in message
    > news:...
    > > Smart idea. Thanks.
    > >
    > > I would put that into the page 'OnLoad' procedure, right?
    > >
    > > Could it trigger pop-up blockers, though?
    > >
    > > "Tim Williams" wrote:
    > >
    > >> You could send back a HTML page with some javascript to load your
    > >> required URL into the top level window.
    > >> Should not mess with the history list.
    > >>
    > >> <script type="text/javascript">
    > >> top.location.replace( "yourURLHere" );
    > >> </script>
    > >>
    > >>
    > >> Tim.
    > >>
    > >>

    >
    >
    >
     
    David GB, Dec 27, 2004
    #5
    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. Replies:
    0
    Views:
    692
  2. xzzy
    Replies:
    4
    Views:
    650
  3. ck388
    Replies:
    1
    Views:
    603
    ck388
    Sep 24, 2003
  4. Julius Mong
    Replies:
    1
    Views:
    392
    Randy Webb
    May 10, 2004
  5. Stefan Mueller
    Replies:
    0
    Views:
    241
    Stefan Mueller
    Nov 7, 2005
Loading...

Share This Page