0
我使用的Site.Master文件来创建日志/使用下面的代码注销现场每一页上:ASP.NET注销事件处理程序和页面的Site.Master
<asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false" >
<AnonymousTemplate>
[ <a href="~/Account/Login.aspx" ID="HeadLoginStatus" runat="server">Log In</a> ]
</AnonymousTemplate>
<LoggedInTemplate>
Welcome <span class="bold"><asp:LoginName ID="HeadLoginName" runat="server" /></span>!
[ <asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" OnLoggedOut="LoginStatus1_LoggedOut" LogoutPageUrl="~/"/> ]
</LoggedInTemplate>
</asp:LoginView>
然而,当用户注销时,我希望能够运行事件处理程序
OnLoggedOut="LoginStatus1_LoggedOut"
和编辑用户表中的一些信息(例如,最后注销时间和什么不可以)。不过,我不知道如何检索这些信息,因为
FormsIdentity id = (FormsIdentity)User.Identity;
显然Site.Master.cs不工作(用户不存在的情况下)。有没有其他方式来检索用户信息?另外,有没有一种方法可以从用户点击“注销”页面传输信息(例如使用查询字符串)?
谢谢