System.Web.UI.WebControls.RoleGroupCollection Class

Contains a sequential list of role groups that the System.Web.UI.WebControls.LoginView control uses to determine which control template to display to users based on their role. This class cannot be inherited.

See Also: RoleGroupCollection Members


[System.ComponentModel.Editor("System.Web.UI.Design.WebControls.RoleGroupCollectionEditor, System.Design, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
public sealed class RoleGroupCollection : CollectionBase


The System.Web.UI.WebControls.RoleGroupCollection class manages the list of role groups associated with a particular System.Web.UI.WebControls.LoginView template. Each role group defines the content and controls to display to a particular group of users on your Web site. It is possible to assign several role groups to the same template.

To find the role group in the collection that a particular user belongs to, you can use the RoleGroupCollection.GetMatchingRoleGroup(System.Security.Principal.IPrincipal) method to search the collection by user name.


The order of the roles in the System.Web.UI.WebControls.RoleGroupCollection collection is important because matching is done sequentially based on the first role found.

You must configure role management to use the System.Web.UI.WebControls.RoleGroupCollection class to manage a list of role groups. For more information, see Understanding Role Management.


Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions:
Since: .NET 2.0