A collection of objects that inherit the MembershipProvider abstract class.
Assembly: System.Web.ApplicationServices (in System.Web.ApplicationServices.dll)
Creates a new, empty membership provider collection.
Gets the number of providers in the collection.(Inherited from ProviderCollection.)
Gets a value indicating whether access to the collection is synchronized (thread safe).(Inherited from ProviderCollection.)
Gets the membership provider in the collection referenced by the specified provider name.
Gets the current object.(Inherited from ProviderCollection.)
Adds a membership provider to the collection.(Overrides ProviderCollection.Add(ProviderBase).)
Removes all items from the collection.(Inherited from ProviderCollection.)
Copies the membership provider collection to a one-dimensional array.
Copies the contents of the collection to the given array starting at the specified index.(Inherited from ProviderCollection.)
Determines whether the specified object is equal to the current object.(Inherited from Object.)
Serves as the default hash function. (Inherited from Object.)
Removes a provider from the collection.(Inherited from ProviderCollection.)
Sets the collection to be read-only.(Inherited from ProviderCollection.)
Returns a string that represents the current object.(Inherited from Object.)
Overloaded. Enables parallelization of a query.(Defined by ParallelEnumerable.)
The membership providers for an application are exposed as a read-only Providers property of the Membership class. You can access a specific membership provider in the collection by name and cast it as the specific provider type, such as SqlMembershipProvider. This enables you to manage membership information from multiple data stores in a single application as well as access custom members of a membership provider that are not part of the MembershipProvider abstract class.by the
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" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>List Enabled Providers</title> </head> <body> <% foreach (ProviderBase p in Membership.Providers) Response.Write(p.Name + ", " + p.GetType() + "<br />"); %> </body> </html>
Available since 2.0
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.