System.Web.Security.Roles.AddUserToRole Method

Adds the specified user to the specified role.

Syntax

public static void AddUserToRole (string username, string rolename)

Parameters

rolename
Documentation for this section has not yet been entered.
username
The user name to add to the specified role.

Remarks

The Roles.AddUserToRole(string, string) method calls the default role provider to associate the specified user with the specified role at the data source.

Note:

User names and role names cannot contain commas.

Requirements

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