System.Web.Security.Roles.RemoveUserFromRoles Method

Removes the specified user from the specified roles.

Syntax

public static void RemoveUserFromRoles (string username, string[] rolenames)

Parameters

rolenames
Documentation for this section has not yet been entered.
username
The user to remove from the specified roles.

Remarks

The Roles.RemoveUserFromRoles(string, String[]) method calls the default role provider to remove the specified user from the specified roles at the data source.

If the application is configured to use the System.Web.Security.SqlRoleProvider class, the database updates that are performed during the call to the Roles.RemoveUserFromRoles(string, String[]) method are made within a transaction. If an error is encountered, such as a user name that is not in a specified role, the transaction is rolled back and no updates are performed.

Requirements

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