开发者

How to check when user authorizated and user's ID :)

开发者 https://www.devze.com 2022-12-21 21:06 出处:网络
protected void Login1_LoggedIn(object sender, 开发者_开发知识库EventArgs e) { { User.SetUser(Login1.UserName // and what is user ID ?
protected void Login1_LoggedIn(object sender, 开发者_开发知识库EventArgs e)
{
    {
        User.SetUser(Login1.UserName // and what is user ID ?

and how to check in other module if user authenticated or not ?


To test if the user is authenticated:

HttpContext.Current.User.Identity.IsAuthenticated 

To get his username if authenticated:

HttpContext.Current.User.Identity.Name
0

精彩评论

暂无评论...
验证码 换一张
取 消