Code Comments
Programming Forum and web based access to our favorite programming groups.Hi, I have a aspx file inside iframe,when authentication cookie expires ,this page will automatically be redirected to log on page but since it's inside an iframe,the log on page is inside iframe too.How can I make parent page to redirect to log on page ? Thanks
Post Follow-up to this messageYou may watch the "onreadystatechange" event of your iframe or check
periodically its src event.
1. onreadystatechange:
myIFrame.onreadystatechange = onIFrameChange();
function onIFrameChange() {
if(myIFrame.src == 'LoginPage.aspx') {
location.href = 'LoginPage.aspx';
}
}
2. periodical check:
function checkIFrame() {
if (myIFrame.src == 'LoginPage.aspx') {
location.href = 'LoginPage.aspx';
} else {
setTimeOut('checkIFrame()', 1000);
// run once in every second
}
}
// Just pay attention to call checkIFrame when the page
// loads.
"ottawa111" <angela_c@verizon.net> wrote in message
news:1113757992.361855.52280@g14g2000cwa.googlegroups.com...
> Hi, I have a aspx file inside iframe,when authentication cookie expires
> ,this page will automatically be redirected to log on page but since
> it's inside an iframe,the log on page is inside iframe too.How can I
> make parent page to redirect to log on page ?
> Thanks
>
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.