asp.net-mvc-3 – ASP.NET MVC 3在web.config中的区域和多个身份
发布时间:2020-12-15 23:00:37 所属栏目:asp.Net 来源:网络整理
导读:我一直在试图跟随这个博客来获得Areas的工作: http://mstechkb.blogspot.com/2010/10/areas-in-aspnet-mvc-20.html 在博客文章中,它标识了每个区域设置身份验证的能力,例如: location path="Area1" system.web authentication mode="Windows" / authorizat
我一直在试图跟随这个博客来获得Areas的工作:
http://mstechkb.blogspot.com/2010/10/areas-in-aspnet-mvc-20.html 在博客文章中,它标识了每个区域设置身份验证的能力,例如: <location path="Area1"> <system.web> <authentication mode="Windows" /> <authorization> <allow roles="role1,role2"/> <deny users="*"/> </authorization> </system.web> </location> 但是,当我尝试在Visual Studio 2010中的一个新项目中创建它时,我运行时会收到以下错误:
从我可以看到这是因为您不能指定身份验证元素,除非它是顶级web.config. 所以有可能做博客文章的内容呢?您可以在web.config中的“位置”元素中包含认证元素区域吗? 解决方法
我学到了关于ASP.NET MVC的知识,总是比较适合将授权规则设置为[Authorization]属性应用于单个控制器,因为考虑到路由系统的工作方式,它更安全,更充分.
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- ASP.NET – meta:ResourceKey vs <%$Resources:MyKey%&
- asp.net-mvc – 编辑多个子记录的ASP.NET MVC示例
- IIS7不会显示ASP.Net错误消息或堆栈跟踪
- asp.net – SignalR如何处理重复的连接ID?
- ASP.NET图表在数字旁边添加百分比
- asp.net – 如何全局创建CustomPrincipal(使用和不使用Auth
- asp.net-mvc – 标准ASP.NET MVC ModelBinder的文档在哪里?
- asp.net-mvc – ActionLink无法在“if”块内渲染
- asp.net-mvc – 我们是否正在使用.Net 3.5中的MVC框架转向经
- asp.net-mvc – jQGrid和MVC 3.0 ViewModel
推荐文章
站长推荐
- ASP.NET MVC基于标注特性的Model验证:一个Model
- 在按钮ASP.NET c#上禁用回发
- asp.net-mvc – 为什么MVC4捆绑捆绑Knockout.js?
- asp.net-mvc – 在Tag Helper上拥有ViewContext属
- Asp.net MVC同名视图,路径不同
- asp.net-mvc – 在ASP.NET MVC ViewModel类中获取
- asp.net-mvc – 使用城堡温莎的实体框架
- asp.net-mvc – 我在MVC 5 Visual Studio 2013中
- asp.net – VS2015为Class Library添加引用
- ASP.NET MVC 2在部分视图中禁用浏览器后退按钮的
热点阅读