System.Web.Security.Roles.Provider Property

Gets the default role provider for the application.

Syntax

public static RoleProvider Provider { get; }

Value

Documentation for this section has not yet been entered.

Remarks

The Roles.Provider property enables you to directly reference the default role provider for an application. This is commonly used to access custom members of the role provider that are not part of the System.Web.Security.RoleProvider abstract class.

For example, the System.Web.Security.WindowsTokenRoleProvider class includes an overload of the WindowsTokenRoleProvider.IsUserInRole(string, System.Security.Principal.WindowsBuiltInRole) method that enables you to determine whether a user is in a common Windows role by using a System.Security.Principal.WindowsBuiltInRole enumeration value. A reference to the System.Web.Security.WindowsTokenRoleProvider class for an application can be obtained by using the Roles.Provider property and can be cast as a System.Web.Security.WindowsTokenRoleProvider in order to refer to the WindowsTokenRoleProvider.IsUserInRole(string, System.Security.Principal.WindowsBuiltInRole) overload.

If multiple role providers are configured for an application, you can access different role providers using the Roles.Providers collection.

Requirements

Namespace: System.Web.Security
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0