Update Database on browser close

I was trying to figure to solve the above problem. I tried following way but did not suite perfectly to my requirement and at last I stick to AJAX which is really fun and interesting to implement it.

1. Tried JavaScript onUnload/Onbeforeunload event
                    Problem 
                         - It does not work properly
                         - Do not have control of current browser
                         - Does note work on Netscape

2. Calling web service from JavaScript
3. Remote Scripting from Java Script.
4. XML Activex Object
5. Using AJAX (For More
http://weblogs.asp.net/mschwarz)
         Tips:   
          - For this make sure you disable the Google Popup for JavaScript onunload.
          - Debuge Java Script error on AJAX.

I will try to write more about this issue later some free time.If you have any question send me a mail.

Cheers.

Suresh Behera

3 Comments

  • Hello,



    I came across your posting regarding using AJAX to update a database onunload. I have been using a popup method onunload for the last while with a web application I have written that integrates with MS Presenter. I was wondering how successful this had been for you... You are able to confirm the AJAX request is processed before the window closes? The window does need to exist in order to ensure successful DB communication?

    --Alan

  • hello, I have teh problem now that you had, because I need to insert in the database the end session time I've tried a lot of things, but anything works. How can I do that????????


    please heeelllllpppp

  • Can you answer the questions, better if you can post examples of the problem you mentioned. You just posted problem not solution. thank you very much.

Comments have been disabled for this content.