System.Web.Security.RoleProvider.IsUserInRole Method

Gets a value indicating whether the specified user is in the specified role for the configured applicationName.

Syntax

public abstract bool IsUserInRole (string username, string rolename)

Parameters

rolename
Documentation for this section has not yet been entered.
username
The user name to search for.

Returns

true if the specified user is in the specified role for the configured applicationName; otherwise, false.

Remarks

The RoleProvider.IsUserInRole(string, string) method is called by the erload:System.Web.Security.Roles.IsUserInRole method of the System.Web.Security.Roles class to determine whether the current logged-on user is associated with a role from the data source for the configured Roles.ApplicationName.

If the specified user name is null or is an empty string, we recommend that your provider throw an exception.

If the specified role name is null or is an empty string, we recommend that your provider throw an exception.

Requirements

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