CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML





Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 10/29/2007 2:40:12 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 5 Views: 63 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
6 Items, 1 Pages 1 |< << Go >> >|
BigJammy
Asp.Net User
Problem with onbeforeunload on masterpage10/29/2007 2:40:12 PM

0/0

I have a master page with a javascript that opens a window. The event work fine the problem is that the event only gets called the first time the content panel changes and never again.

 I idealy would like the window only to open if the masterpage is navigated away from. Is this possible to do?

Johnson2007
Asp.Net User
Re: Problem with onbeforeunload on masterpage10/30/2007 8:42:11 AM

0/0

Sorry. Do not get your mean very clear. How did you implement it?


Johnson
BigJammy
Asp.Net User
Re: Problem with onbeforeunload on masterpage10/30/2007 12:32:02 PM

0/0

I have a web application that need to allows a user to login once.

The masterpage has a onbeforeunload event that calls an aspx page to unlock account.

The problem is that the onbeforeunload gets called when the content panel changes.

 I need it to be called only when someone navigates away from web application.

Johnson2007
Asp.Net User
Re: Problem with onbeforeunload on masterpage10/31/2007 3:55:21 AM

0/0

BigJammy:
 I need it to be called only when someone navigates away from web application.
 

Session_End event in Global.asax will raise when user navigates away from you web application. Or have I had any misunderstand? 


Johnson
BigJammy
Asp.Net User
Re: Problem with onbeforeunload on masterpage10/31/2007 8:05:18 AM

0/0

The problem with using session_end is that is only get called once the session times out or Session.Abandon is called.

 I have tried this but it only get called once the session times out.

 When a user closes the web application it does not end the session.

Johnson2007
Asp.Net User
Re: Problem with onbeforeunload on masterpage11/1/2007 10:46:06 AM

0/0

 Because Master page plays as a server control of content page at runtime, If you exchange between different content pages that reference to the same master page, acturlly the whole page has changed. Therefore the whole page life cycle has come through when you exchange between different content page.

So, it hard to determin whether a user left the web application only on one page. I think one approach may solve your problem, although may not be the best one, using frameset.  That means create a frameset( the html and script code like the below), and in this frameset page write the code to handle of exiting the page. Because this frameset page is the most outside page that holds other pages in its frame, when user leave this page, he must left the application.

 

<html>
<head>

<script type="text/javascript">
<!--

window.onunload = function()
{
	window.open ("Pop.htm");
}
//-->
</script>
</head>
<script type="text/javascript">
<!--

	var sHtml = '<frameset rows="*,100%" border=0>' +
	'		<frame name="index" id="index" src="AnyInexistentPage.htm" frameborder=0>' +
	'		<frame name="template" id="template" src="../test4/Default2.aspx"'+ location.search +'" frameborder=0 noresize scrolling=no>' +
	'	</frameset>';
	document.write(sHtml);

//--></script>
</html>
  
Johnson
6 Items, 1 Pages 1 |< << Go >> >|


Search This Site:







Web:
Problem with onbeforeunload on masterpage - ASP.NET Forums Re: Problem with onbeforeunload on masterpage. 10-30-2007, 4:42 AM ... Re: Problem with onbeforeunload on masterpage. 10-30-2007, 8:32 AM ...
[JS] Ask confirm to exit page with pending changes (onbeforeunload ... Actually problem the user has still not exit browser, they link to other pages ... My application has a masterpage which contains a Form. ...
Logout User on Windows close.... - .NET Forum I am writing this onbeforeUnload event in master page... so is there any problem arises due to the master page ? ...
MSDN SharePoint - InfoPath Forms Services onbeforeunload fired ... when the user click ok , onbeforeunload is called twice so there are two warning messages. I was able to solve this problem but now if the user click 2 time ...
onbeforeunload error found in searching for help on the event onbeforeunload. ... MasterPage Samples · urlMappings all folders must use default.apsx ...
Microsoft: ASP.NET - Adding attribute to body tag in masterpage I'm trying to add two tags to the body tag into a masterpage to give Handle the window.onbeforeunload event in .NET code behind page ... ") ... 2, Adding Javascript body onload events in WebPages with MasterPage · ASP. ...
CodeProject: Dirty Panel Extender (ASP.NET AJAX). Free source code ... The window.onbeforeunload callback is the essential hook that will trap closing of ..... I'm using the snippet of code published to work with a master page. ...
Add onbeforeunload event with contentplaceholder page : Asp .Net Hi, I would like to add a onbeforeunload function to contentplaceholder page? How can I. ... Are you talking about the content page, or the master page? ...
Master Page prevents using style sheets? that was contained in the master page. So my questions are: ..... Post Other interesting topics. Problem with RaiseCallbackEvent ...









 
All Times Are GMT