Click here to Skip to main content
15,914,608 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello all,

I want to fire browser close(X) event in code behind. how to crack this event in asp.net

Thanks in advance
Regds
Posted
Comments
[no name] 21-Jul-12 11:18am    
You are asking how to write server code to close the browser window on the client computer? Think about that for a minute.

1 solution

Well, you cannot 'crack' as such.

Maximum you can do this, if it helps:
C#
Page.ClientScript.RegisterStartupScript(this.GetType(),"close","window.close();",true);

This will inject Javascript code to close the current browser window where your website is.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900