C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
What is Role provider in ASP.NET
WhatsApp
Sapna
14y
7.8
k
0
0
25
Blog
During the development of ASP.NET application, the asp.net role management enables you the easy use of number of different providers. As you can implement your own provider or use the supplied profile providers which are included with the .NET Framework.
Reasons for creating a custom role provider:
To store role information in a data source which doesn't supported by the role providers in the .NET Framework.
To manage role information using a database schema different from the database schema used by the providers in the .NET Framework.
Implementing a role provider:
You need to create a class that inherits the RoleProvider abstract class from the System.Web.Security namespace. The RoleProvider abstract class then inherits the ProviderBase abstract class from the System.Configuration.Provider namespace. Next, you should retrieve the configuration information from the web.config file in the
Initialize
method.
At last, you have to implement
GetRolesForUser
method where you will get all the groups where the current user belongs to.
Thanx.
What is Role provider in ASP.NET
People also reading
Membership not found