redirect unauthenticated users from frameset child pages?

Discussion in 'ASP .Net' started by =?Utf-8?B?V2lsbGlhbSBTdWxsaXZhbg==?=, Nov 2, 2005.

  1. Have a frameset HTML page (parent) with child .aspx pages. When each of the
    child pages loads, it checks to see if the user is authenticated, and if not,
    redirects to the login page:

    if(!this.Context.User.Identity.IsAuthenticated)
    {
    Response.Redirect("Login.aspx",true);
    }

    The problem is that if I go to the parent page directly, I get four versions
    of the login page, each in a different frame. How do I redirect the browser,
    not just the frame, to the login page?
    =?Utf-8?B?V2lsbGlhbSBTdWxsaXZhbg==?=, Nov 2, 2005
    #1
    1. Advertising

  2. Should have checked before I posted. Plenty of info about this out there.
    My solution was: For each frame page save the header page, I replaced
    Response.Redirect with plain ol' Response.End() to prevent anything from
    showing from those pages. To the header page, I replaced Response.Redirect
    with:

    Response.Write("Redirecting to Login.aspx. Click <a
    href=\"Login.aspx\">here</a> if this fails.");
    Response.Write("<script language='javascript'>top.location.href
    =\"Login.aspx\"</script>");
    Response.End();

    This writes out a javascript line that will redirect the frameset page to
    the login page, and if this fails for some reason, leaves an informative
    message and link for users.

    "William Sullivan" wrote:

    > Have a frameset HTML page (parent) with child .aspx pages. When each of the
    > child pages loads, it checks to see if the user is authenticated, and if not,
    > redirects to the login page:
    >
    > if(!this.Context.User.Identity.IsAuthenticated)
    > {
    > Response.Redirect("Login.aspx",true);
    > }
    >
    > The problem is that if I go to the parent page directly, I get four versions
    > of the login page, each in a different frame. How do I redirect the browser,
    > not just the frame, to the login page?
    =?Utf-8?B?V2lsbGlhbSBTdWxsaXZhbg==?=, Nov 2, 2005
    #2
    1. Advertising

  3. =?Utf-8?B?V2lsbGlhbSBTdWxsaXZhbg==?=

    Bruce Barker Guest

    it would be cleaner to have the frameset page check first.

    -- bruce (sqlwork.com)


    "William Sullivan" <> wrote in
    message news:...
    > Have a frameset HTML page (parent) with child .aspx pages. When each of
    > the
    > child pages loads, it checks to see if the user is authenticated, and if
    > not,
    > redirects to the login page:
    >
    > if(!this.Context.User.Identity.IsAuthenticated)
    > {
    > Response.Redirect("Login.aspx",true);
    > }
    >
    > The problem is that if I go to the parent page directly, I get four
    > versions
    > of the login page, each in a different frame. How do I redirect the
    > browser,
    > not just the frame, to the login page?
    Bruce Barker, Nov 2, 2005
    #3
  4. I agree. However, when I added the frameset page, VS added it as a plain
    HTML page. Can I convert the frameset page to aspx and use its page_load
    event to do this checking? I would prefer to do this, but I'm not sure that
    it would work.

    "Bruce Barker" wrote:

    > it would be cleaner to have the frameset page check first.
    >
    > -- bruce (sqlwork.com)
    >
    >
    > "William Sullivan" <> wrote in
    > message news:...
    > > Have a frameset HTML page (parent) with child .aspx pages. When each of
    > > the
    > > child pages loads, it checks to see if the user is authenticated, and if
    > > not,
    > > redirects to the login page:
    > >
    > > if(!this.Context.User.Identity.IsAuthenticated)
    > > {
    > > Response.Redirect("Login.aspx",true);
    > > }
    > >
    > > The problem is that if I go to the parent page directly, I get four
    > > versions
    > > of the login page, each in a different frame. How do I redirect the
    > > browser,
    > > not just the frame, to the login page?

    >
    >
    >
    =?Utf-8?B?V2lsbGlhbSBTdWxsaXZhbg==?=, Nov 2, 2005
    #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. bradley
    Replies:
    1
    Views:
    825
    Peter Rilling
    Jun 8, 2005
  2. Keithb
    Replies:
    0
    Views:
    421
    Keithb
    Oct 28, 2006
  3. Klaus Jensen
    Replies:
    1
    Views:
    388
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
    Jun 19, 2008
  4. Jerry C
    Replies:
    3
    Views:
    184
    Luke Zhang [MSFT]
    Jun 16, 2006
  5. Replies:
    0
    Views:
    310
Loading...

Share This Page