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

后端 未结 7 840
清歌不尽
清歌不尽 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 06:18

    If you're using URL rewrite or change your URL,it may be cause return Empty null value.You should try change path of your URL from .html to .aspx or none extendtion. this is issue for my case.You try.I hope this useful

提交回复
热议问题