asp.net 启用windows身份验证,怎么登出??

解决方案 »

  1.   

    整个页面关掉就登出了。呵呵。windows身份验证只要他页面开着就能从后台获取到当前windows身份
      

  2.   

    当前用户的用户组信息怎么获取??
    user.isinrole 这个不起作用
    web.config 配置也不起作用。为什么???????
      

  3.   


    window.close();这个是win form 的吧,我这里讨论的是asp.net
      

  4.   

    登陆时保存的是Session,注销把session清空不就得了吗。
      

  5.   


    windows 验证 不是 form 验证
      

  6.   

    见帖
    http://topic.csdn.net/u/20100519/21/d81f5c49-b7a5-4716-9693-de452dd4cb67.html?89306
    我有回复 应该也是那种情况吧
      

  7.   

    Re: Windows Authentication: LogoutAug 19, 2009 09:23 PM|LINKThe way to do this is to use Javascript, not ASP.NET. Credit goes to a tip I read here.Here's the code to put in your ASPX page.HEADER SECTION<head runat="server"> 
        <title>Header</title> 
        <script language="javascript"> 
            if(self.location==top.location)self.location="Default.html"; 
                    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"); 
                                if (top.location != location) { 
                                    top.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> 
        <link href="styles/StyleSheet.css" rel="stylesheet" type="text/css" /> 
    </head> BODY SECTION<body>
        <div style="position: absolute; width:99%; text-align:right; left: 0px; top: 54px; z-index: 100;">
            <asp:HyperLink ID="HyperLink1" runat="server" Style="z-index: 102; right: 10px;
                position: absolute; top: 0px" NavigateUrl="javascript:Logout()" Width="40px">Logout</asp:HyperLink>
        </div>
    </body>
    Rizwan Gulamhussein