RE: Page unload event
From: Mike (Mike_at_discussions.microsoft.com)
Date: 11/17/04
- Next message: ajit: "access modifier for webcontrols"
- Previous message: Ed Chiu: "Re: panel's controls collection lost during postback"
- In reply to: Weston Weems: "Page unload event"
- Next in thread: Scott Mitchell [MVP]: "Re: Page unload event"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 17 Nov 2004 13:19:01 -0800
I will. I've been struggling with this for a few days and noticed your post
after I had already posted mine. I tried the suggestion that someone replied
to you with and it doesn't work any better.
"Weston Weems" wrote:
> I too have this requirement, I've been able to use both
> onUnLoad, and onBeforeUnload() to catch the request to
> leave the page, however I havent been able to distinguish
> between page reload/postback and going away from the page.
>
> I figured if there was a way I could know what the new url
> was, I'd be ok, but doesnt seem that information is
> avaliable at the time hte unload event is fired off.
>
> If you find any more information on this... please do post
> it here.
>
> Thanks
> Weston Weems
>
>
> >-----Original Message-----
> >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?
> >.
> >
>
- Next message: ajit: "access modifier for webcontrols"
- Previous message: Ed Chiu: "Re: panel's controls collection lost during postback"
- In reply to: Weston Weems: "Page unload event"
- Next in thread: Scott Mitchell [MVP]: "Re: Page unload event"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|