Detect browser window close event in ASP.NET
I need to do something, while closing the browser window. How can I get the browser window close event in ASP.NET?

See All Responses Below...
Message Rating
Posted on: 04/06/2012

try the following line of code from your codebehind:

ScriptManager.RegisterClientScriptBlock(Page, GetType(Page), "close", "window.close();", True)

Please Login to Post Your Comments
Name (Max. 100 characters)
Please post your comments here
Select Language
Attach File(Max. Size: 2 MB)
A few simple rules when posting your Comments,
  1. Please post only answers relevant to the topic of discussion.
  2. Please dont misuse this site or do not be abusive, offensive, inappropriate,harass anyone on the boards or post ads or spam. Doing so will delete your inappropriate messages and will block or delete your account on this site. 

Academic Projects