Roles::DeleteRole Method (String^)
.NET Framework (current version)
Removes a role from the data source.
Assembly: System.Web (in System.Web.dll)
Parameters
- roleName
-
Type:
System::String^
The name of the role to delete.
Return Value
Type: System::Booleantrue if roleName was deleted from the data source; otherwise, false.
| Exception | Condition |
|---|---|
| System::ArgumentNullException | roleName is null. |
| System::ArgumentException | roleName is an empty string or contains a comma (,). |
| System.Configuration.Provider::ProviderException | roleName has one or more members. -or- Role management is not enabled. |
The DeleteRole method removes a role name from the data source. DeleteRole calls the DeleteRole method of the default role provider to remove the specified role from the data source.
If the role identified by the roleName parameter has one or more members, then an exception will be thrown and the role will not be deleted.
.NET Framework
Available since 2.0
Available since 2.0
Show: