Click here to Skip to main content
15,440,323 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How to end user session when browser closed.I am using fllowing Code.It's Not working.What is the error of this Code?

using System.Web.Services;

public static void AbandonSession()

<script type="text/javascript">
  function HandleOnclose() {
    alert("Close Session");
  window.onbeforeunload = HandleOnclose;

1 solution

The first result when I Googled - end session on browser close asp net[^] is a CodeProject tip - How to end user session when browser closed[^]

Please search before you ask.
Share this answer
breaker-code 5-Dec-14 6:09am    
I search.i try you's NOt working.
Ankur\m/ 5-Dec-14 6:13am     CRLF
There is a discussion board at the end of the article. You can post your question there. Please be specific and describe what exactly is not working. Also there are many more discussions in the Google search result. Read them and try. Of course most of the solutions provided there are already used by programers.
Thanks7872 5-Dec-14 6:24am    
And not working is not at all informative.

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