private void Page_Load(object sender, System.EventArgs e) { string Action = (Request.QueryString["Action"]!=null)?Request.QueryString["Action"].ToString():"1"; // clear everything UDS.Components.Staff staff = new UDS.Components.Staff(); staff.Logout(Request.Cookies["Username"].Value.ToString()); staff = null; FormsAuthentication.SignOut(); //Request.Cookies.Clear(); //HttpCookie UserCookie = new HttpCookie("UserID", string.Empty); //HttpCookie UserNameCookie = new HttpCookie("Username", string.Empty); //Response.Cookies.Add(UserCookie); //Response.Cookies.Add(UserNameCookie); Session.Clear(); //Server.Transfer("Index.aspx"); if(Action=="1") { Response.Write("<script language=javascript>window.close();</script>"); } if(Action=="2") { Server.Transfer("Index.aspx"); } }
private void Page_Load(object sender, System.EventArgs e) { string Action = (Request.QueryString["Action"] != null)?Request.QueryString["Action"].ToString():"1"; // clear everything UDS.Components.Staff staff = new UDS.Components.Staff(); staff.Logout(Request.Cookies["Username"].Value.ToString()); staff = null; FormsAuthentication.SignOut(); //Request.Cookies.Clear(); //HttpCookie UserCookie = new HttpCookie("UserID", string.Empty); //HttpCookie UserNameCookie = new HttpCookie("Username", string.Empty); //Response.Cookies.Add(UserCookie); //Response.Cookies.Add(UserNameCookie); Session.Clear(); //Server.Transfer("Index.aspx"); if (Action == "1") { Response.Write("<script language=javascript>window.close();</script>"); } if (Action == "2") { Server.Transfer("Index.aspx"); } }