码迷,mamicode.com
首页 > Web开发 > 详细

[Asp.Net] Form验证中 user.identity为false

时间:2016-06-13 22:10:24      阅读:190      评论:0      收藏:0      [点我收藏+]

标签:

这个方法可以是user.identity设置为true

FormsAuthentication.SetAuthCookie(Username, true);

 

 但是要开启form验证,

在配置文件中

<authentication mode="Forms"></authentication>

 

还有有的项目中默认移除了from验证的module, You need to remove this line

<system.webServer>
<modules>
<remove name="FormsAuthentication" />
</modules>
</system.webServer>

 

[Asp.Net] Form验证中 user.identity为false

标签:

原文地址:http://www.cnblogs.com/qslcna/p/5582015.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!