Asp.net授权不起作用? [英] Asp.net Authorization not working?
本文介绍了Asp.net授权不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的.Net MVC Web应用程序中,我通过使用web.config文件中的位置标记来控制对html页面(index.html)的访问.
在我的开发环境中,这很好用.
但是,当我将网站发布到IIS时,它无法正常工作,并且显示的是index.html而不是登录页面.
Web.Config:
In my .Net MVC web application I am controlling access to a html page (index.html) by using location tag in my web.config file.
This is working fine in my development environment.
But when I publish the website to IIS it is not working and it is showing index.html instead of logon page.
Web.Config:
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="2880" protection="All" />
</authentication>
<location path="index.html">
<system.web>
<authorization>
<deny users="?" ></deny>
</authorization>
</system.web>
</location>
推荐答案
我得到了解决方案:)
^ ]
谢谢,
沙爹
I got the solution :)
http://weblogs.asp.net/scottgu/archive/2007/03/04/tip-trick-integrating-asp-net-security-with-classic-asp-and-non-asp-net-urls.aspx[^]
Thanks,
Satish
这篇关于Asp.net授权不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文