#region Events /// <summary> /// The page losd event of Site master page. /// </summary> /// <param name="sender">The object sender.</param> /// <param name="e">The event arguments.</param> protected void Page_Load(object sender, EventArgs e) { if (Session[KaizenConstants.CURRENTLOGGEDINUSER] == null) { Response.Redirect("Login.aspx"); } if (!IsPostBack) { if (Session[KaizenConstants.CURRENTLOGGEDINUSER] == null) { UserManagementController userManagementController = new UserManagementController(); IUserEntity user = UserManagementEntityCreator.GetUserEntity(); string userName = HttpContext.Current.User.Identity.Name; user.NetworkId = userName.Substring(userName.IndexOf("\\") + 1); currentUserID = user.NetworkId; Result result = userManagementController.Get(user); user = result.Entity as IUserEntity; if (user.Id > 0) { Session[KaizenConstants.CURRENTLOGGEDINUSER] = result.Entity; } else { Response.Redirect("QCError.aspx"); } } } }
$(function () { $('#logButton').click(function () { Logout(); }); }); function Logout() { debugger; var currenturl = window.location.href; $.ajax({ url: currenturl + '/Logout', type: 'POST', contentType: 'application/json; charset=utf-8', dataType: "json", success: function (result) { window.open('', '_self', ''); window.close(); }, error: function (error) { window.open('', '_self', ''); window.close(); }, async: false }); }
protected void Session_End(object sender, EventArgs e) { // Retrieve your Session ID here }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)