473,320 Members | 1,691 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Saving data while closing a window

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.

Nov 29 '05 #1
1 1512
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" <ch************@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr 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.

Nov 29 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: vladislav.moltchanov | last post by:
I am developing an Access tool for generating an Application MDB for data entry in a "large scale" project. At design stage I would like to keep open these two MDB. One current is generating forms...
2
by: Roy Scarisbrick | last post by:
I have a programming issue on an ASP.Net web page. I suspect the issue would apply to any version of ASP though. I have a questionnaire page where a user will answer a bunch of questions with...
1
by: pmclinn | last post by:
I have a formated a structure as follows: <Serializable()>public structure stcOutPut private data as string private visi as string end structure Instances of this strucuture are stored in an...
0
by: neilsanner | last post by:
Hi, I'm using VB 2005 Express Edition. I've just added a data source to my project. In the tutorial I follow (* see link below), it says that I should be able to drag a table from the data...
1
by: M B HONG 20 | last post by:
Hi all - I am developing an ASP.NET (C#) web application. I need a form to save all information upon a user clicking the "X" close button (top right corner). After some research I have come to...
1
by: dbuchanan | last post by:
Hello, A section in Data Sources window is mystifying to me. In the case of my code the Data Sources window shows my references to the data access layer. First here is what I see in my Data...
2
by: laks | last post by:
Hi I'm opening an aspx page with javascript: window.showModalDialog("mypage.aspx", "", "status:no"); In mypage.aspx I've got a button which shall first save the displayed record in the C# code...
10
by: David Lee Conley | last post by:
When I open the Data Sources window and create a new data source, everything works fine. But if I have a form showing in the IDE, the Data Sources window becomes disabled and doesn't display any...
1
by: Magnus | last post by:
I'm testing walkthrough saving data to a Database (Multiple Tables). http://msdn2.microsoft.com/en-us/library/4esb49b4(VS.80).aspx In the famous Customer/Order example, I'm getting referential...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.