System.Web.Security.Roles.DeleteRole Method

Removes a role from the data source.

Syntax

public static bool DeleteRole (string rolename, bool throwOnPopulatedRole)

Parameters

rolename
Documentation for this section has not yet been entered.
throwOnPopulatedRole
If true, throws an exception if roleName has one or more members.

Returns

true if roleName was deleted from the data source; otherwise; false.

Remarks

The Roles.DeleteRole(string, bool) method removes a role name from the data source. Roles.DeleteRole(string, bool) calls the RoleProvider.DeleteRole(string, bool) method of the default role provider to remove the specified role from the data source.

If throwOnPopulatedRole is true, then an exception will be thrown and the role will not be deleted if the role identified by the roleName parameter has one or more members. If throwOnPopulatedRole is false, then the role will be deleted whether it is empty or not.

Requirements

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