RolePrincipal.ProviderName Property

Gets the name of the role provider that stores and retrieves role information for the user.

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

No code example is currently available or this language may not be supported.
/** @property */
public String get_ProviderName ()

public function get ProviderName () : String

Not applicable.

Property Value

The name of the role provider that stores and retrieves role information for the user.

The ProviderName property exposes the name of the role provider that manages the role information for the user represented by the RolePrincipal object. This enables you to access the specific role-provider instance for a user by using the Providers property of the Roles class regardless of whether the provider is the default provider for the application. For example, you may create a method that takes a RolePrincipal as input and returns the list of roles for the represented user. You can ensure that the appropriate role provider is used to return the list of roles for the RolePrincipal by calling the GetRolesForUser method of the role provider from the Providers collection that is indexed by the ProviderName property value.

To populate the RolePrincipal object for each request, you must use a GetRoles event handler defined in the Global.asax file for the application.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: