We help IT Professionals succeed at work.

How to break the Frame

leowlf
leowlf asked
on
I have a frame.  It loads some .asp into the frame.

If the user connection has time-out, i want to redirect the user to the login page and i want to break the frame so the the login page would appear as a single page in the browser.

The Response.Redirect cannot break the frame.  Is there anyway i can do it?
 
Comment
Watch Question

Commented:
yep,

when you notice your connection/session has timed out, you'll have to redirect the user to the login page with a simple Response.Redirect

In your login-page (which will be loaded inside the frame) you'll have to put some JavaScript to make sure it's loaded in "full-screen".

This can be used:

<script language="javascrip">
if (top.document.location.href != document.location.href) {
  top.document.location.replace (document.location.href);
}
</script>

(To know if your connection has timed out you can set a boolean to false in your session_onstart event, and set it to true when a user has logged on.)

Commented:
Instead of Response.Redirect, try this:

When you know that the session have already expired:

Dim IsDeadSession
IsDeadSession = YourFunctionToTestTheSession()

If IsDeadSession Then Response.Write "<html><body onload=""javascript:top.document.location.href='" & yourURLHere & "'""></body></html>"

Enjoy.

Author

Commented:
etmemdz,
There are some points for you in another question.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.