Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Frames and ASP.NET 1

Status
Not open for further replies.

hanglam

Programmer
Dec 11, 2002
143
0
0
US
Hi,

I have this problem. I used a frameset with two frames.
The left side frame contains an .aspx page which contains links to be displayed on the right frame.
The right frame displays .aspx pages that are click from the left frame.

I use ASP.NET Forms Authentication and I set a Session Timeout of 10 minutes.

My problem is everytime my app times out, both frames get redirected to my "Login Page".

Is there a way to redirect the whole frameset/page to my Login page instead of having the "Login page" in each frame ?

Thanks,
Hang
 
Yes you can. One way I've done it in the past for a site that used frames (although this was an ASP site) is simply by using javascript and making the page "jump out" of the frames so that is just goes to a login page with no frames displayed.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
ca8msm,

how do you code that in the ASP.NET Web.config file or the ASP.NET code once the session has timed out ?
It is an automatic redirection by ASP.NET once a session has timed out.

Thanks,
Hang

 
You don't create any ASP.NET code - that is the whole point. As your session has timed out, both frames will redirect back to your login.aspx page. What you have to do, is place some javascript code on your login.aspx page to check if it is in a frame. If it is, simply "jump out" of the frames to only show one of them.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
ca8msm,

can you provide a short example of the Javascript code ?
I used to be able to do it using old ASP code like you said, but with ASP.NET , I can't do it the same way as before because of its automatic redirection feature for Forms Authentication once it times out.

Thanks man,

hang
 
I used to be able to do it using old ASP code like you said, but with ASP.NET , I can't do it the same way as before because of its automatic redirection feature for Forms Authentication once it times out.
It doesn't matter if it is ASP or ASP.NET as in both cases the session timed out and it is the client javascript we utilise on the login page to jump out of the frames. i.e the session times out, both frames are set to the login page but the javascript from those pages fires and they jump out of the frames to create one page.

The javascript that I used was something along the lines of:
Code:
	<Script Language="JavaScript">
	<!--
	setTimeout ("changePage()", 0);
	function changePage() {
		if (self.parent.frames.length != 0)
		self.parent.location= "login.asp";
	}
	// -->
	</script>



____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
ca8msm,

oh, I see what you are talking about now . Just do a check on the login page using Javascript to check for frames .

Thanks,
Hang
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top