tags:

views:

25

answers:

1

Hi, I have an asp login form that opens into a prettyphoto modal window via iframe from my main asp page.

I can complete this form and login no problem but it loads the protected pages in the prettyphoto modal window. Is it possible to have this window close and redirect to the parent page once login form is submitted?

Example: index.asp has link to login.asp Login Now!

On submission of login.asp it calls another asp file as such:

Else

Session("UserID")= RS("UserID")
Session("UserName")= RS("Name")
Session("Login")= "YES"

Response.redirect "vipindex.asp"

End If

Is it possible to have the Response.redirect "vipindex.asp" load into the "parent window" closing the current? When I say parent window I mean the original index.asp?

Kind regards

Gary

+1  A: 

Instead of redirecting to the vipindex.asp directly you could do

Else

Session("UserID")= RS("UserID")
Session("UserName")= RS("Name")
Session("Login")= "YES"
%>
<script type="text/javascript">
  window.top.location = 'vipindex.asp';
</script>
<%
End If

but keep in mind that this solution relies on javascript being enabled for it to work..

Gaby
Bloody brilliant Gaby, thank you so much for that it works a treat. I wonder if its also possible to
gary brett
gary brett
@Gary, you want the window to appear and when you close it to redirect you ? or to appear when you login and persist while the new page loads (*the second is not really possible -if you use an HTML dialog- because when the new page loads it will recreate the DOM, and if you do create a normal window (popup - **not good**) it cannot be modal*)..
Gaby
No problem Gaby I will stick with what you suggested first, it works lovely for me. Thanks again
gary brett