Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Saving data while closing a window

Reply
Thread Tools

Saving data while closing a window

 
 
M B HONG 20
Guest
Posts: n/a
 
      11-29-2005
I am working on an ASP.NET web application (C#), and need a web form to
either save data on a click of the "X" (Top right corner of the
browser) or just disable the "X" altogether. I have a "Save" button
which is tied to a C# event which saves all of my data via from
sessions, or from the form directly etc., but i need it to save the
data in the event that the user decides to close it with the "X". I am
aware of the browser's native onClose property, but I am not sure if it
can call a C# command from there, and also if it can call a C# command,
does that C# command have access to the form's fields? Any help would
be greatly appreciated.

 
Reply With Quote
 
 
 
 
Peter Rilling
Guest
Posts: n/a
 
      11-29-2005
It is unlikely that you will be able to invoke a postback when the window
closes. Now you might be able to hook the close event in JavaScript and
alert the user. Maybe even give them a chance to cancel the close so they
can save their work. Ultimately this would be user error if they close the
window with data that has not been saved.

"M B HONG 20" <> wrote in message
news: oups.com...
>I am working on an ASP.NET web application (C#), and need a web form to
> either save data on a click of the "X" (Top right corner of the
> browser) or just disable the "X" altogether. I have a "Save" button
> which is tied to a C# event which saves all of my data via from
> sessions, or from the form directly etc., but i need it to save the
> data in the event that the user decides to close it with the "X". I am
> aware of the browser's native onClose property, but I am not sure if it
> can call a C# command from there, and also if it can call a C# command,
> does that C# command have access to the form's fields? Any help would
> be greatly appreciated.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Closing popup window when closing parent window? =?Utf-8?B?Vk1J?= ASP .Net 3 02-15-2007 08:29 AM
Bookmarks saving as blank text, window not closing (Firefox 2.0.0.1) afairjudgement@gmail.com Firefox 1 02-09-2007 06:21 PM
Closing child window WITHOUT closing parent thomas Javascript 0 10-23-2003 04:10 PM
Saving Images While Saving ASP Pages ! Lovely Angel For You ASP General 1 10-03-2003 12:03 AM
Opening one window while closing the current using JavaScript andPHP... Eric B Venet Javascript 0 07-31-2003 04:45 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57