【发布时间】:2013-09-15 07:47:33
【问题描述】:
我的 asp.net mvc4 应用程序出现授权错误。我机器的账户管理员就是这个
我的会话属性:
在我的 web.config 文件中我把这个 sn-p:
<authentication mode="Windows" />
<authorization>
<allow users = "Lamloumi" />
<deny users="?"/>
</authorization>
当我启动应用程序时,我无法访问它。
这个错误的原因是什么?如何修复我的代码?
【问题讨论】:
-
见here,这可能会有所帮助。之前有人问过类似的问题
-
不,它没有改变任何东西!我看不出有什么区别。另外,如果我输入`
` 我可以访问该网站!!为什么? -
我把
string s = User.Identity.Name;放在控制器里,s的值是空字符串!!! -
你可以试试这个httpcontext.current.user.identity.name
-
httpcontext 不包含属性 current !!
标签: asp.net .net asp.net-mvc-4 web-config authorization