Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Anybody can redirect or help me to find the solution on how to trap the event in IE that when the users click the Back Button or X in IE the program (C# .NET) will recognize it and run a function in the back ground before perfoming the back button or X command in IE.

Thanks in Advance.

Best Regards
Posted
Updated 3-Jun-11 22:28pm
v2

 
Share this answer
 
Comments
Espen Harlinn 5-Jun-11 5:57am    
Nice link, my 5
hi,,

it had to get closing event of browser . because this event fire every action such as refresh and all any way try this link below

http://forums.asp.net/p/1493430/3515598.aspx[^]
 
Share this answer
 
thanks but both example is not working for me IE8.
 
Share this answer
 
Comments
Christian Graus 4-Jun-11 8:26am    
First of all, don't push 'answer' if you're not answering. Second, are you using ASP.NET ? If so, your C# code does not run on the client and cannot detect those things. If not, then how is your C# code going to run to detect these things ? What you want to do, can't really be done, not reliably. If you cannot depend on these things happening, you should just not bother trying. You can write javascript to stop people hitting the back arrow, but anyone can defeat it, so it's better to fix your code so they can hit the back arrow without there being any issue.

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