1.首先请检查Web.config中的authentication mode的值,它应设置为Forms。
<authentication mode="Forms"/>
2.在编程过程下,用户名可以用下面两个中的一个来引用:
Page.User.Identity.Name
HttpContext.Current.User.Identity.Name
1.首先请检查Web.config中的authentication mode的值,它应设置为Forms。
<authentication mode="Forms"/>
2.在编程过程下,用户名可以用下面两个中的一个来引用:
Page.User.Identity.Name
HttpContext.Current.User.Identity.Name
转载于:https://www.cnblogs.com/netact/articles/1800871.html