RoleProviderCollection.Item Property (String)

 

Gets the role provider in the collection referenced by the specified provider name.

Namespace:   System.Web.Security
Assembly:  System.Web (in System.Web.dll)

member Item : 
        name:string -> RoleProvider with get

Parameters

name
Type: System.String

The name of the role provider.

Property Value

Type: System.Web.Security.RoleProvider

An object that inherits the RoleProvider abstract class.

The role providers for an application are exposed as a read-only RoleProviderCollection by the Providers property of the Roles class. You can access a specific role provider in the collection by name and cast it as the specific provider type, such as SqlRoleProvider. This enables you to manage role information from multiple data stores in a single application as well as access custom members of a role provider that are not part of the RoleProvider abstract class.

The following code example accesses a SqlRoleProvider configured for an application from the Providers property of the Roles class by name.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: