smalloy
Posts: 107
|
| Posted: 08/26/2005, 12:42 PM |
|
Unfortunately I use Iframes for some of my application. When the user times out the access denied page shows up in the frame rather than the whole page. Is there any way to change this and have it show from _self to _top?
Thanks for any suggestions,
Steve
_________________
Anything can be done, just give me time and money. |
 |
 |
dataobjx
Posts: 181
|
| Posted: 08/31/2005, 10:09 AM |
|
Mr Malloy
Step 1)
Assuming you have a page with Restricted = Yes and it's pointing To an Access Denied Page called: AccessDenied.asp
Step 2)
In the access denied page place the following script
<script language="JavaScript">
<!--
var sURL = "default.asp"
function doLoad()
{
// the timeout value should be the same as in the "refresh" meta-tag
setTimeout( "refresh()", 3*1000 );
}
function refresh()
{
// This version of the refresh function will cause a new
// entry in the visitor's history. It is provided for
// those browsers that only support JavaScript 1.0.
//
window.top.location.href = sURL;
}
//-->
</script>
<script language="JavaScript1.1">
<!--
function refresh()
{
// This version does NOT cause an entry in the browser's
// page view history. Most browsers will always retrieve
// the document from the web-server whether it is already
// in the browsers page-cache or not.
window.top.location.href = sURL;
}
//-->
</script>
<script language="JavaScript1.2">
<!--
function refresh()
{
// This version of the refresh function will be invoked
// for browsers that support JavaScript version 1.2
//
// The argument to the location.reload function determines
// if the browser should retrieve the document from the
// web-server. In our example all we need to do is cause
// the JavaScript block in the document body to be
// re-evaluated. If we needed to pull the document from
// the web-server again (such as where the document contents
// change dynamically) we would pass the argument as 'true'.
//
window.top.location.href = sURL;
}
//-->
</script>
Step 3
In the body tag of the accessdenied.html page place the following code;
<body onload="javascript:doLoad();>
What will happen is this;
The access denied page will appear within the frame... then after 3 seconds it will refresh to the default.asp page in the parent window this time....
you can change this at the top of the script where is states:
var sURL = "default.asp"
_________________
www.DataObjx.net
www.mydigitalapps.com |
 |
 |
|