0

I have a question and I will be grateful if you could share ideas.

I have a ASPX web page with a textbox and a button. The textbox contains an integer. When the button is clicked, it will be transferred to another page wherein a certain integer field in a database, subtracted with the value on the textbox is displayed. The value in the database also is reflected with the calculation.

However, when the browser is closed, I want to re-add the value to database, like a rollback. Will it be possible to do that?

Joseph
  • 47
  • 8
  • 1
    You'll need to do it in JavaScript (have it run inside the browser and make API calls), and you'll have to deal with the user leaving the site over a link or via the back button as described [here](https://stackoverflow.com/a/3888938/9363973) – MindSwipe Nov 13 '20 at 10:52
  • 1
    What if the browser crashes or there is a network error. There will be no rolback. I would not depend on a mechanic like this. Better rethink your design. – VDWWD Nov 13 '20 at 11:05

0 Answers0