Redigera

Dela via


MembershipSection.DefaultProvider Property

Definition

Gets or sets the name of the default provider that is used to manage roles.

public:
 property System::String ^ DefaultProvider { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("defaultProvider", DefaultValue="AspNetSqlMembershipProvider")]
[System.Configuration.StringValidator(MinLength=1)]
public string DefaultProvider { get; set; }
[<System.Configuration.ConfigurationProperty("defaultProvider", DefaultValue="AspNetSqlMembershipProvider")>]
[<System.Configuration.StringValidator(MinLength=1)>]
member this.DefaultProvider : string with get, set
Public Property DefaultProvider As String

Property Value

The name of a provider in Providers. The default is AspNetSqlRoleProvider.

Attributes

Examples

The following code example demonstrates how to use the DefaultProvider property. This code example is part of a larger example provided for the MembershipSection class.

// Display Default Provider.
Console.WriteLine("DefaultProvider: {0}",
  configSection.DefaultProvider);
' Display Default Provider.
Console.WriteLine("DefaultProvider: {0}", _
 configSection.DefaultProvider)

Remarks

The DefaultProvider must match a named value in the providers subsection of the membership section of the configuration file. An empty string ("") is not a valid value for the DefaultProvider property.

Applies to