How to Store Logout information when browser tab closed using asp.net c#.net and javascript
I have checked in all browsers its working fine.I have already shared Some articles related to this.
How to create a login page in Aspnet with sqlserver
How to create a LOGOUT Page using Sessions
A journey from Login Page to Logout Page in Asp.net
Now, "How to Store Logout information when browser tab closed using asp.net c#.net and javascript"
Let's Start:
First Step : Write the following simple script to call logout button event
When you close the tab, beforeunload script function will be fire and then it calls necessary button event
In Next Step:
Write the necessary code in button Event
protected void btnLogout_Click(object sender, EventArgs e) { Session.Abandon(); Session.Remove("Username"); //Save the Necessary logout information in Database. Response.Redirect("Home.aspx"); }
Labels: .Net Tutorials, Aspnet, C#, CSharp, javascript
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home