RolePrincipal.ProviderName Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the name of the role provider that stores and retrieves role information for the user.
public:
property System::String ^ ProviderName { System::String ^ get(); };
public string ProviderName { get; }
member this.ProviderName : string
Public ReadOnly Property ProviderName As String
Property Value
The name of the role provider that stores and retrieves role information for the user.
Remarks
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.
Applies to
See also
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: I hele 2024 udfaser vi GitHub-problemer som feedbackmekanisme for indhold og erstatter det med et nyt feedbacksystem. Du kan få flere oplysninger under:Indsend og få vist feedback om