允许在身份验证web.config中使用特定路径 [英] Allow specific path in authentication web.config
本文介绍了允许在身份验证web.config中使用特定路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想允许所有用户导航到特定的路径。
我已经尝试了
< location path = 〜/ Styles >
< system.web>
< authorization>
< allow users = * />
< / 授权 >
< / system.web >
< / location >
< system.web>
<身份验证模式= 表单 >
< forms loginUrl = 〜/ Views / Login.aspx protection = 无 path = / timeout = 30 />
< / 身份验证 >
< authorization>
< deny users = ? />
< allow users = * />
< / 授权 >
< / system.web >
但是仍然不允许我进入'样式'文件夹
解决方案
因为我可以在root中看到你的样式文件夹,所以你可以在web配置中使用下面的脚本。
< 位置 路径 = 样式 inheritInChildApplications = false >
< system.web >
< 授权 >
< allow 用户 = < span class =code-keyword> * / >
< / authorization >
< / system.web >
< / location > 跨度>
Hi,
I want to allow all users to navigate to particular path.
I have tried
<location path="~/Styles">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<system.web>
<authentication mode="Forms">
<forms loginUrl="~/Views/Login.aspx" protection="None" path="/" timeout="30" />
</authentication>
<authorization>
<deny users ="?" />
<allow users = "*" />
</authorization>
</system.web>
But still it is not allowing me inside 'Styles' folder
解决方案
As I can see your code your style folder in root so you can use below script in web config.
<location path="Styles" inheritInChildApplications="false"> <system.web> <authorization> <allow users="*"/> </authorization> </system.web> </location>
这篇关于允许在身份验证web.config中使用特定路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文