Reputation: 779
I have created a web application using ext.net and c# in visual studio 2010. When the user click on the about button, the about window is displayed from the index page. In web.config file I have following code:
<authentication mode="Forms">
<forms loginUrl="~/Login.aspx" protection="All" defaultUrl="~/Login.aspx" timeout="2000"/>
</authentication>
My problem is that, when the session is expired and the user click on the about button, the login page is displayed inside the about window. I have to refresh the page manually to redirect to the login page. I don't want the login page display in the about window when session is expire. Any help?
Thanks in advance!
Upvotes: 0
Views: 387
Reputation: 8337
Put the below javascript in the login page head section
<script>
if(self!=top)
top.location.href=window.location.href;
</script>
self
means the current window, that will become the window inside the frame. top
means the top most window. that is the browser window. So if top!=self
means if the current window is not the topmost window
Upvotes: 2