ASP.NET FormsAuthentication and membership

一笑奈何 提交于 2019-12-04 20:17:32

You can certainly use roles without Membership. In fact, prior to ASP.NET 2.0 we didn't have Membership at all, garsh darnit, and we liked it that way!! ;-)

Here's an article that shows how to implement roles without Membership: Role-Based Authorization With Forms Authentication. In a nutshell, you have to write some code that assigns the roles to the user once they're authenticated.

Happy Programming!

Sure you can--the Authorize element just interrogates the IPrincipal living in the HttpContext.Current.User property as to which roles it has. Now, if you were to say, stuff your own custom principal, into that object, you could very easily have roles and such.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!