<%@ Page Language="C#" AutoEventWireup="true" CodeFile="logout.aspx.cs" Inherits="test" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Logout</title> <script language="javascript"> function Logout() { try { if(window.XMLHttpRequest) { alert("You have been logged off from this website. Note that if you run Internet Explorer 6.0 without service pack 1 you need to close all browser windows in order to complete the log off process."); document.execCommand("ClearAuthenticationCache", "false"); self.location.href = "."; } else { alert("This feature requires Internet Explorer 6.0 Service Pack 1 or above. " + "Please close all browser windows in order to complete the logout process."); } } catch (e) { alert("This feature requires Internet Explorer 6.0 Service Pack 1 or above. " +"Please close all browser windows in order to complete the logout process."); } } </script> </head> <body> <form id="form1" runat="server"> <div> <a href=javascript:Logout()>Logout</a> </div> </form> </body> </html>