gpt4 book ai didi

c# - HttpContext.Current.User.Identity.IsAuthenticated 在登录控件 LoggedIn 事件中为 false

转载 作者:行者123 更新时间:2023-12-03 19:08:46 25 4
gpt4 key购买 nike

我很生气为什么 HttpContext.Current.User.Identity.IsAuthenticated 在登录控件的 LoggedIn 事件中返回 false?

我输入了正确的用户名和密码,因此我进入了登录事件,但 IsAuthenticated 是错误的!

最佳答案

这是因为自从用户登录后页面还没有被回发。整个用户对象还没有被填充,这是一个已知的行为。

请参阅这篇内容丰富的博文:

http://forums.asp.net/t/982749.aspx

上述链接也归功于此相关的 SO QA: Get UserID from ASP.Net Login control LoggedIn event

关于c# - HttpContext.Current.User.Identity.IsAuthenticated 在登录控件 LoggedIn 事件中为 false,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13166107/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com