This documentation is archived and is not being maintained.

remove Element for providers for roleManager (ASP.NET Settings Schema)

Removes a reference to an inherited provider from the collection of role management providers.

configuration Element (General Settings Schema)
  system.web Element (ASP.NET Settings Schema)
    roleManager Element (ASP.NET Settings Schema)
      providers Element for roleManager (ASP.NET Settings Schema)
        remove Element for providers for roleManager (ASP.NET Settings Schema)
<remove 
   name=" provider name" 
/>

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute

Description

name

Required String attribute.

The name of the role provider instance to remove from the collection. This attribute must be the same as the name attribute of the add element that added the role provider to the collection.

Child Elements

None.

Parent Elements

Element

Description

configuration

The required root element in every configuration file used by the common language runtime and .NET Framework applications.

system.web

Specifies the root element for the ASP.NET configuration section.

roleManager

Configures an application for role management.

providers

Defines a collection of role providers for role management.

The remove element removes a reference to an inherited provider from the collection of role management providers stored in the providers element.

The providers element defines a collection of role providers for role management.

For information about accessing and modifying configuration values for the roleManager element in application code, see the RoleManagerSection class.

The following example shows an ASP.NET application configured to use the SqlRoleProvider to store and retrieve role information. The <remove> element removes the default SQL Server role provider instance before adding the new SqlRoleProvider instance.

<configuration>
  <system.web>
      <roleManager defaultProvider="SqlProvider" 
                   enabled="true"
                   cacheRolesInCookie="true"
                   cookieName=".ASPROLES"
                   cookieTimeout="30"
                   cookiePath="/"
                   cookieRequireSSL="false"
                   cookieSlidingExpiration="true"
                   cookieProtection="All" >
        <providers>
        <remove name="AspNetSqlProvider" />
          <add
            name="SqlProvider"
            type="System.Web.Security.SqlRoleProvider"
            connectionStringName="SqlServices" 
            applicationName="SampleApplication" />
            
        </providers>
      </roleManager>
  </system.web>
</configuration>

Configuration Section Handler

RoleManagerSection

Configuration Member

Providers

Configurable Locations

Machine.config

Root level Web.config

Application level Web.config

Requirements

IIS 5.0, IIS 5.1, or IIS 6.0

.NET Framework 2.0

Visual Studio 2003, or Visual Studio 2005

Show: