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. Window Close Button

Window Close Button

Scheduled Pinned Locked Moved ASP.NET
helpquestion
10 Posts 6 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.
  • A Offline
    A Offline
    Agweet
    wrote on last edited by
    #1

    Hi all, i am stuck on a huge problem, i want to either hide, disable or be able to capture the event of the close button on a window. Is there a way i can do this? Thanks in advance!

    living life on the flip side

    M L P 3 Replies Last reply
    0
    • A Agweet

      Hi all, i am stuck on a huge problem, i want to either hide, disable or be able to capture the event of the close button on a window. Is there a way i can do this? Thanks in advance!

      living life on the flip side

      M Offline
      M Offline
      mr_muskurahat
      wrote on last edited by
      #2

      you cannot capture browser close event...

      umerumerumer

      A 1 Reply Last reply
      0
      • M mr_muskurahat

        you cannot capture browser close event...

        umerumerumer

        A Offline
        A Offline
        Agweet
        wrote on last edited by
        #3

        So is there anything i can do...such as hide or disable the button?

        living life on the flip side

        1 Reply Last reply
        0
        • A Agweet

          Hi all, i am stuck on a huge problem, i want to either hide, disable or be able to capture the event of the close button on a window. Is there a way i can do this? Thanks in advance!

          living life on the flip side

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Agweet wrote:

          event of the close button on a window.

          try using onunload="function()" with body tag

          1 Reply Last reply
          0
          • A Agweet

            Hi all, i am stuck on a huge problem, i want to either hide, disable or be able to capture the event of the close button on a window. Is there a way i can do this? Thanks in advance!

            living life on the flip side

            P Offline
            P Offline
            Perspx
            wrote on last edited by
            #5

            Agweet wrote:

            i want to either hide, disable or be able to capture the event of the close button on a window.

            There is no way for you to hide/disable the close button, as this poses security risks. Why would you want to do that anyway? Regards, --Perspx

            A 1 Reply Last reply
            0
            • P Perspx

              Agweet wrote:

              i want to either hide, disable or be able to capture the event of the close button on a window.

              There is no way for you to hide/disable the close button, as this poses security risks. Why would you want to do that anyway? Regards, --Perspx

              A Offline
              A Offline
              Agweet
              wrote on last edited by
              #6

              what i am doing is creating a application where a certain user can only login with a specific username once at a time...so if a user logs in with administrator then some 1 else cant use that username, now the reason i want to disable the close button is that if a user pushes the close button then they need to get logged out in the database...hence i want to force them to use my logout button so i can execute the function to log them out...if that makes sense...please ask me any more questions if there is something you dont understand.

              living life on the flip side

              L 1 Reply Last reply
              0
              • A Agweet

                what i am doing is creating a application where a certain user can only login with a specific username once at a time...so if a user logs in with administrator then some 1 else cant use that username, now the reason i want to disable the close button is that if a user pushes the close button then they need to get logged out in the database...hence i want to force them to use my logout button so i can execute the function to log them out...if that makes sense...please ask me any more questions if there is something you dont understand.

                living life on the flip side

                L Offline
                L Offline
                lobbychmd
                wrote on last edited by
                #7

                i think u can use session.

                A 1 Reply Last reply
                0
                • L lobbychmd

                  i think u can use session.

                  A Offline
                  A Offline
                  Agweet
                  wrote on last edited by
                  #8

                  Hi, can u please elaborate for me on how i could use a session to log a user out?

                  living life on the flip side

                  C 1 Reply Last reply
                  0
                  • A Agweet

                    Hi, can u please elaborate for me on how i could use a session to log a user out?

                    living life on the flip side

                    C Offline
                    C Offline
                    Christian Graus
                    wrote on last edited by
                    #9

                    What you want, is impossible. You *can* handle the unload event and send a message with AJAX to your server, but you still cannot guarantee that it will always be sent. Your best bet is to use the session and use a timeout, so that if someone doesn't log out, they have to wait until the timeout period to be able to log back in.

                    Christian Graus Driven to the arms of OSX by Vista.

                    A 1 Reply Last reply
                    0
                    • C Christian Graus

                      What you want, is impossible. You *can* handle the unload event and send a message with AJAX to your server, but you still cannot guarantee that it will always be sent. Your best bet is to use the session and use a timeout, so that if someone doesn't log out, they have to wait until the timeout period to be able to log back in.

                      Christian Graus Driven to the arms of OSX by Vista.

                      A Offline
                      A Offline
                      Agweet
                      wrote on last edited by
                      #10

                      so wat you saying is i should create a timer and set it as a count down timer...but then what will happen if a user click close, then how will it log them out?...i fail to understand what exactly you are saying!

                      living life on the flip side

                      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