Roles.RemoveUserFromRole Method (String, String)
.NET Framework (current version)
Removes the specified user from the specified role.
Assembly: System.Web (in System.Web.dll)
Parameters
- username
-
Type:
System.String
The user to remove from the specified role.
- roleName
-
Type:
System.String
The role to remove the specified user from.
| Exception | Condition |
|---|---|
| System.ArgumentNullException | roleName is null. -or- username is null. |
| System.ArgumentException | roleName is an empty string or contains a comma (,) username is an empty string or contains a comma (,). |
| System.Configuration.Provider.ProviderException | Role management is not enabled. |
The RemoveUserFromRole method calls the default role provider to remove the specified user from the specified role at the data source.
.NET Framework
Available since 2.0
Available since 2.0
Show: