RoleProvider::DeleteRole Method (String^, Boolean)
Removes a role from the data source for the configured applicationName.
Assembly: System.Web.ApplicationServices (in System.Web.ApplicationServices.dll)
Parameters
- roleName
-
Type:
System::String^
The name of the role to delete.
- throwOnPopulatedRole
-
Type:
System::Boolean
If true, throw an exception if roleName has one or more members and do not delete roleName.
DeleteRole is called by the DeleteRole and the DeleteRole methods of the Roles class to delete the specified role from the data source for the configured ApplicationName.
When you delete a role from the data source, ensure that you also delete any associations between a user name and the deleted role for the configured applicationName.
If throwOnPopulatedRole is true, and the role identified by the roleName parameter has one or more members, throw a ProviderException and do not delete the role. If throwOnPopulatedRole is false, then delete the role whether it is empty or not.
If the specified role name does not exist, is null, or is an empty string, we recommend that your provider throw an exception.
Available since 2.0