RoleGroupCollection.GetMatchingRoleGroup Method

Note: This method is new in the .NET Framework version 2.0.

Returns the first role group that contains the specified user account.

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

public RoleGroup GetMatchingRoleGroup (
	IPrincipal user
)
public RoleGroup GetMatchingRoleGroup (
	IPrincipal user
)
public function GetMatchingRoleGroup (
	user : IPrincipal
) : RoleGroup

Parameters

user

An IPrincipal that represents the user account to find the role group collection.

Return Value

A RoleGroup representing the first role group in the collection that contains the specified user account. If the user is not part of a role group in the collection, it returns a null reference (Nothing in Visual Basic).

Exception typeCondition

ArgumentNullException

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

The GetMatchingRoleGroup method searches the role group collection and returns the first role group that contains the specified user account. The method searches the collection in the order role groups are added to the collection, and returns only the first matching role group.

If the specified user account is not part of any of the role groups in the collection, a null reference (Nothing in Visual Basic) is returned.

You must configure role management to use the GetMatchingRoleGroup method. For more information, see Understanding Role Management.

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

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show: