By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,855 Members | 1,970 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,855 IT Pros & Developers. It's quick & easy.

redirect unauthenticated users from frameset child pages?

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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.