RoleGroup.ContainsUser Method

Indicates whether the specified user is a member of any of the roles in the role group.

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)

public:
bool ContainsUser (
	IPrincipal^ user
)
public boolean ContainsUser (
	IPrincipal user
)
public function ContainsUser (
	user : IPrincipal
) : boolean
Not applicable.

Parameters

user

The user name to look for in the role group.

Return Value

true if the user is a member of one of the roles associated with this role group; otherwise, false.

Exception typeCondition

ArgumentNullException

User is a null reference (Nothing in Visual Basic).

The ContainsUser method returns true if the specified user is a member of any of the roles associated with this role group. Roles are searched in the order they are listed in the Roles property, and searching stops after the first match is found.

This method uses the IsUserInRole method to determine whether a user is a member of a role. You must configure role management to use the ContainsUser method. For more information, see Understanding Role Management.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: