471,319 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,319 software developers and data experts.

redirect unauthenticated users from frameset child pages?

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?
Nov 19 '05 #1
3 2445
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?

Nov 19 '05 #2
it would be cleaner to have the frameset page check first.

-- bruce (sqlwork.com)
"William Sullivan" <Wi*************@discussions.microsoft.com> wrote in
message news:2A**********************************@microsof t.com...
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?

Nov 19 '05 #3
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" <Wi*************@discussions.microsoft.com> wrote in
message news:2A**********************************@microsof t.com...
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?


Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Steve | last post: by
3 posts views Thread by Justin | last post: by
1 post views Thread by Tony Zoccolillo | last post: by
3 posts views Thread by Paul Evans | last post: by
2 posts views Thread by news://news.microsoft.com/microsoft.public.de.germ | last post: by
reply views Thread by =?Utf-8?B?U2VtU2Vt?= | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.