Share via


DefaultRoleProvider.IsUserInRole Method

Determines whether a user is in a role.

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

Syntax

'Declaration
Public Overrides Function IsUserInRole ( _
    username As String, _
    roleName As String _
) As Boolean
'Usage
Dim instance As DefaultRoleProvider 
Dim username As String 
Dim roleName As String 
Dim returnValue As Boolean 

returnValue = instance.IsUserInRole(username, _
    roleName)
public override bool IsUserInRole(
    string username,
    string roleName
)
public:
virtual bool IsUserInRole(
    String^ username, 
    String^ roleName
) override
abstract IsUserInRole : 
        username:string * 
        roleName:string -> bool  
override IsUserInRole : 
        username:string * 
        roleName:string -> bool
public override function IsUserInRole(
    username : String, 
    roleName : String
) : boolean

Parameters

  • username
    Type: System.String
    The name of the user to search for.
  • roleName
    Type: System.String
    The name of the role to search in.

Return Value

Type: System.Boolean
true if the specified user is in the specified role; otherwise, false.

See Also

Reference

DefaultRoleProvider Class

System.Web.Providers Namespace

Other Resources

ASP.NET Identity