Page unload event

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Mike (Mike_at_discussions.microsoft.com)
Date: 11/17/04


Date: Wed, 17 Nov 2004 12:15:06 -0800

I have a web form in my application that will be used for both viewing and
updating information. I have a requirement that if any data has been changed
on the page and the user attempts to leave the page without saving, the user
gets prompted with a message asking if they want to save changes.

It seemed logical to put any code to handle this in the page unload event,
however the page unload event gets fired every time the page does a post
back, like when the user changes a value in a dropdown list for example.

I attempted to check for IsPostBack, before displaying the save message. But
in that case the save message never gets displayed, even when leaving the
page completely.

Does anyone have any idea how to tackle this problem, or is this an
impossible requirement?



Relevant Pages

  • RE: Page unload event
    ... > avaliable at the time hte unload event is fired off. ... >>I attempted to check for IsPostBack, before displaying ...
    (microsoft.public.dotnet.framework.aspnet)
  • Page unload event
    ... however I havent been able to distinguish ... avaliable at the time hte unload event is fired off. ... >I attempted to check for IsPostBack, before displaying ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Missing: hour/minute / second data (smalldatetime)
    ... The way it is displayed depends on the gui that is displaying it unless you ... >> 1) What does the source time say? ... >> Try viewing the table in Query Analyzer to see if they are truly missing. ...
    (microsoft.public.sqlserver.dts)
  • Re: request_uri alternative
    ... It is displaying the page viewing and not the page it was ... approach would be to rewrite the URLs in all the links using ... The reason for this was to be able to put the user back on the page after a link took him elsewhere. ... It was my thought that it held the value of the page the linked the page I am viewing. ...
    (comp.lang.php)
  • Re: request_uri alternative
    ...  It is displaying the page viewing and not the page it was ... confused if the user opens more than one window and also has the ... overhead of maintaining a session for every user. ...
    (comp.lang.php)