Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How To Log when user clicks on the cross button through Ajax

How To Log when user clicks on the cross button through Ajax

Scheduled Pinned Locked Moved ASP.NET
databasecsharpasp-nettoolshelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shimona 2
    wrote on last edited by
    #1

    I am handling one project in asp.net.Now I want to update my sql database when anyone leave the domain. So I need to call a stored Procedure when user leave page. And I can do it very easily if user click on logout button. But the problem arises when anyone just close the browser (by clicking cross button) or when he navigate away to another page (typing another address in address bar). Some ppl said that this can be done with Ajax script. Anyone please provide some coding for this?

    Regards, Shimona

    S S 2 Replies Last reply
    0
    • S shimona 2

      I am handling one project in asp.net.Now I want to update my sql database when anyone leave the domain. So I need to call a stored Procedure when user leave page. And I can do it very easily if user click on logout button. But the problem arises when anyone just close the browser (by clicking cross button) or when he navigate away to another page (typing another address in address bar). Some ppl said that this can be done with Ajax script. Anyone please provide some coding for this?

      Regards, Shimona

      S Offline
      S Offline
      saanj
      wrote on last edited by
      #2

      Try the following link: http://www.developerfusion.com/forum/thread/24783/[^] Regards Saanj

      Either you love IT or leave IT...

      1 Reply Last reply
      0
      • S shimona 2

        I am handling one project in asp.net.Now I want to update my sql database when anyone leave the domain. So I need to call a stored Procedure when user leave page. And I can do it very easily if user click on logout button. But the problem arises when anyone just close the browser (by clicking cross button) or when he navigate away to another page (typing another address in address bar). Some ppl said that this can be done with Ajax script. Anyone please provide some coding for this?

        Regards, Shimona

        S Offline
        S Offline
        Sujay chakraborty
        wrote on last edited by
        #3

        hey shimona 2, The issue can be dealed with javascript, Please go through the following html code that captures the close button click event

        <html>
        <head>
        <script language="javascript" type="text/javascript">
        window.onbeforeunload = myunload;
        function myunload()
        {
        alert('Window is closing!!');
        }
        </script>
        </head>
        <body>
        </body>
        </html>

        Hope this helps Regards

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups