如何在 VB.net 中使用 ASP.net 4.0 将用户路由到 Web 表单页面之前检查用户角色
我有一个使用 asp.net 成员身份和 URL 路由的 asp.net Web 表单应用程序。 由于角色的工作方式,我无法在每个文件夹中的 web.config 文件的允许/拒绝标签中放置“AND”或“OR”等。
这是一个商业网站,是从包含许多应用程序的 vb.net win forms 项目移植而来的。 (win forms 项目有一个自定义身份验证系统。)
Web 应用程序的结构模仿了桌面套件,并为每个应用程序创建了一个文件夹。 还有一些通用文件夹,任何应用程序的任何用户都可以在其中生成报告。
角色的结构如下
App1 被许可人
I have an asp.net web forms application that uses asp.net membership and URL Routing.
Because of the way Roles work, i cant put an "AND" or "OR", etc. in the allow/deny tags of the web.config file that resides in each folder.
This is a business website that that is being ported from a vb.net win forms project that contianed many apps. (The win forms project have a custom authentication system.)
The web app is structured in a way to mimic the desktop suites and a folder was created for each app.
There are also common folders where any user of any app can generate a report.
The roles are structured as such
App1
Licensee
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简单的方法:将验证放在 global.asax 的 Application_BeginRequest 事件上。
如果需要,您可以创建一个 HttpHandler 来管理它。以下是更多信息:http://msdn.microsoft。 com/en-us/library/5c67a8bd(v=vs.71).aspx
希望有帮助。
Easy way: put that validation on your global.asax's Application_BeginRequest event.
If you want, you could create an HttpHandler for managing that. Here's more info: http://msdn.microsoft.com/en-us/library/5c67a8bd(v=vs.71).aspx
Hope it helps.