HttpContext.Current.User.Identity.Name is always string.Empty

后端 未结 7 835
清歌不尽
清歌不尽 2020-12-01 05:21

Hi I use a custom MembershipProvider.

I want to know the current username during an application scenario, but when I try accessing HttpContext.Current.User.Identity.

7条回答
  •  再見小時候
    2020-12-01 05:58

    in VS Community 2015 version, if you create a web forms application, it automatically add codes in web.config node to remove FormsAuthentication, try remove below section

    
      
    
    

提交回复
热议问题