Article ID: 306238 - View products that this article applies to.
This article was previously published under Q306238
This article describes how to implement role-based security in an ASP.NET application that implements forms-based authentication using Visual Basic .NET.
(http://support.microsoft.com/kb/308157/EN-US/ )How To Implement Forms-Based Authentication in Your ASP.NET Application by Using Visual Basic .NET
Use the sample code in this section to implement role-based security in your application. This sample code assigns pre-specified roles to the authenticating user. Depending how you store your user data, you can implement your own method to retrieve the roles for that authenticated user and attach those roles to the authenticating user's identity, which is illustrated in the sample code to follow.
Copy the following code in your Global.asax file in your existing application to assign the roles to the authenticating user in the Application_AuthenticateRequest event handler:
For an overview on ASP.NET security, see the following article in the Microsoft Knowledge Base:
306590For more information about role-based security, refer to the following .NET Framework Software Development Kit (SDK) documentation:
(http://support.microsoft.com/kb/306590/EN-US/ )INFO: ASP.NET Security Overview
Role-Based SecurityThe documentation and source code at the following MSDN Web site also contains information about role-based security:
IBuySpy Developer SolutionsFor more information, refer to the following books:
Reilly, Douglas J. Designing Microsoft ASP.NET ApplicationsMicrosoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party contact information.
(http://www.microsoft.com/mspress/books/toc/5136.aspx). Microsoft Press, 2001.
Esposito, Dino. Building Web Solutions with ASP.NET and ADO.NET
(http://www.microsoft.com/MSPress/books/5727.aspx). Microsoft Press, 2001.
Article ID: 306238 - Last Review: October 24, 2012 - Revision: 4.0
Contact us for more help
Connect with Answer Desk for expert help.