bagni99
asked on
reload parent from iframe
Hi,
This is probably easy but I can't seem to find the perfect answer to this.
I have an iframe that defaults to a login page when the session times out. What I want is the parent page to load the login page when the iframe session times out.
This is the iframe code that I need to change:
<%
If Not IsLoggedIn And Request.Cookies(ewProjectN ame)("auto login") = "autologin" And Request.Cookies(ewProjectN ame)("pass word") <> "" Then Response.Redirect "login.asp"
Call LoadUserLevel()
If IsLoggedIn Then
ewCurSec = CurrentUserLevelPriv("occa sion of service")
Else
ewCurSec = GetAnonymousPriv("occasion of service")
End If
If (ewCurSec And ewAllowList) <> ewAllowList Then Response.Redirect "login.asp"
%>
Thanks very much
bagni99
This is probably easy but I can't seem to find the perfect answer to this.
I have an iframe that defaults to a login page when the session times out. What I want is the parent page to load the login page when the iframe session times out.
This is the iframe code that I need to change:
<%
If Not IsLoggedIn And Request.Cookies(ewProjectN
Call LoadUserLevel()
If IsLoggedIn Then
ewCurSec = CurrentUserLevelPriv("occa
Else
ewCurSec = GetAnonymousPriv("occasion
End If
If (ewCurSec And ewAllowList) <> ewAllowList Then Response.Redirect "login.asp"
%>
Thanks very much
bagni99
ASKER
Thanks mplungjan, but the login page still opens in the iframe....I can't work it out.....I replaced both Response.Redirects with your script....bugger...bugger. ..bugger.. ..can I say bugger here?
I even tried replacing the word 'top' with the word 'parent'...that didn't work either.
I even tried replacing the word 'top' with the word 'parent'...that didn't work either.
Is the parent from a different domain than the iframe?
If so, try "<script>window.open('logi n.asp','_t op')</scri pt>"
I know it looks weird, but that will not get the "Access Denied" error I think you might be getting if the iframe is from a different server (even a different protocol or port will be a different domain)
Michel
If so, try "<script>window.open('logi
I know it looks weird, but that will not get the "Access Denied" error I think you might be getting if the iframe is from a different server (even a different protocol or port will be a different domain)
Michel
ASKER
tried it.....no good....just can't bust out of the iframe.
Maybe there's something else I'm missing....I have to run but will keep at it.
Maybe there's something else I'm missing....I have to run but will keep at it.
try
"<script>alert('Trying to bust'); window.open('login.asp','_ top')</scr ipt>"
"<script>alert('Trying to bust'); window.open('login.asp','_
try:
<script language=javascript>parent .location. reload()</ script>
from the iframe
<script language=javascript>parent
from the iframe
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
@Inviser: He wants to load the login page that normally would be in the iframe
@Hugo: it is only if the iframe code wants to load the loginpage, so what is less complicated about your code?
@Hugo: it is only if the iframe code wants to load the loginpage, so what is less complicated about your code?
guess Hugo is almost there.
Then Response.Write "<script>top.location = 'login.asp'</script>"
Then Response.Write "<script>top.location = 'login.asp'</script>"
Erm third: http://#18451669
ASKER
HugoHiasl's answer did it, thank god. Thank you all!
Hmm, very strange
My
top.location.replace('logi n.asp')
and
Hugo's
top.location="/yourloginpa ge.html";
and
Thirds
top.location = 'login.asp'
all will load login in the parent
ONLY reason Hugo's solution would be any better is if the code is in the login page.
If the code in the iframe is different than the login page, then my code will not break the back button
My
top.location.replace('logi
and
Hugo's
top.location="/yourloginpa
and
Thirds
top.location = 'login.asp'
all will load login in the parent
ONLY reason Hugo's solution would be any better is if the code is in the login page.
If the code in the iframe is different than the login page, then my code will not break the back button
ASKER
You got it....I put Hugos code in the actual login page.
Right, Not easy to guess
Then Response.Redirect "login.asp"
to
Then Response.Write "<script>top.location.repl