3 Replies - 1145 Views - Last Post: 04 January 2010 - 06:56 AM Rate Topic: -----

#1 cipi20052000  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 25
  • Joined: 26-August 09

CLOSING WEB PAGE

Posted 02 January 2010 - 06:42 AM

Hi everybody! I really need some help! I have a web page with a button. When I press the button something happens (it doesn't matter what). What I want to do is: when I close the browser (the page is closing, too) I want to call the button1_click function. How can I do that?
Is This A Good Question/Topic? 0
  • +

Replies To: CLOSING WEB PAGE

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1633
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: CLOSING WEB PAGE

Posted 02 January 2010 - 10:18 AM

First, topics merged, please dont create duplicates :)

You cannot, you cannot detect from a web application when someone has closed their browser. What exactly are you trying to implement, there may be a different route you can take.
Was This Post Helpful? 0
  • +
  • -

#3 cipi20052000  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 25
  • Joined: 26-August 09

Re: CLOSING WEB PAGE

Posted 02 January 2010 - 11:28 AM

View PostPsychoCoder, on 2 Jan, 2010 - 09:18 AM, said:

First, topics merged, please dont create duplicates :)

You cannot, you cannot detect from a web application when someone has closed their browser. What exactly are you trying to implement, there may be a different route you can take.

I'm trying to do a little on-line game and when I close the web page(not necessary the browser) I want to make the status of the player "offline". This thing I'm doing when the I press the "logout" button. And I was wondering if there's any way I could call the LogoutButton_click event when I close the web page....
Was This Post Helpful? 0
  • +
  • -

#4 s_kucksdorf  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 69
  • Joined: 12-May 09

Re: CLOSING WEB PAGE

Posted 04 January 2010 - 06:56 AM

Use the "onunload" event in javascript. Then in the event handler type in "__doPostBack( X, Y)" where X (in your case) would be the button, and Y would be the argument. Hope this helps. Happy coding!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1