asp.net.ph

RoleProviderCollection Class

System.Web.Security Namespace


.NET Framework version 2.0

A collection of objects that inherit the RoleProvider abstract class.

RoleProviderCollection Class Members

Collapse   Constructors

Visibility Constructor Parameters
public RoleProviderCollection ( )

Collapse   Properties

Visibility Name Value Type Accessibility
public Item ( String name ) RoleProvider [ Get ]

Collapse   Methods

Visibility Name Parameters Return Type
public Add ( ProviderBase provider ) Void
public CopyTo ( RoleProvider array , Int32 index ) Void

Remarks

The role providers for an application are exposed as a read-only RoleProviderCollection by the Providers property of the Roles class. You can access a specific role provider in the collection by name and cast it as the specific provider type, such as SqlRoleProvider. This enables you to manage role information from multiple data stores in a single application as well as access custom members of a role provider that are not part of the RoleProvider abstract class.

Example

The following code example lists the providers enabled for an application and their respective types.

<%@ Page Language = "C#" %>
<%@ Import Namespace = "System.Web.Security" %>
<%@ Import Namespace = "System.Configuration.Provider" %>
<html>
<head>
   <title>List Enabled Providers</title>
</head>

<body>

<%
foreach ( RoleProvider p in Roles.Providers ) {
   Response.Write ( p.Name + ", " + p.GetType ( ) + "<br>" );
}
%>

</body>
</html>
  C# VB

See Also

RoleManagerModule Class   RolePrincipal Class   RoleProvider Class   Roles Class Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph