Share via


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

Removes all references to inherited role providers, allowing only the role providers that are added by the current add element.

This element is new in the .NET Framework version 2.0.

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)
        clear Element for providers for roleManager (ASP.NET Settings Schema)

<clear/>

Attributes and Elements

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

Attributes

None.

Child Elements

None.

Parent Elements

Element

Description

configuration

Specifies the required root element in every configuration file that is used by the common language runtime and the .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.

Remarks

The clear element removes all references to inherited role management providers that are stored in the providers element, allowing only the role management providers that are added by subsequent add elements.

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 RoleManagerSection.

Example

The following code example shows how to configure an ASP.NET application to use the SqlRoleProvider provider to store and retrieve role information. The <clear> element clears the RoleProviderCollection collection before adding the SqlRoleProvider.

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

Element Information

Configuration section handler

RoleManagerSection

Configuration member

Providers

Configurable locations

Machine.config

Root-level Web.config

Application-level Web.config

Requirements

Microsoft Internet Information Services (IIS) version 5.0, 5.1, or 6.0

The .NET Framework version 2.0

Microsoft Visual Studio 2003 or Visual Studio 2005

See Also

Tasks

How to: Configure Specific Directories Using Location Settings

How to: Lock ASP.NET Configuration Settings

Reference

providers Element for roleManager (ASP.NET Settings Schema)

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

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

roleManager Element (ASP.NET Settings Schema)

system.web Element (ASP.NET Settings Schema)

configuration Element (General Settings Schema)

System.Configuration

System.Web.Configuration

RoleManagerSection

RoleManager

Concepts

Understanding Role Management

Securing ASP.NET Configuration

ASP.NET Configuration Scenarios

Other Resources

General Configuration Settings (ASP.NET)

ASP.NET Configuration Settings

ASP.NET Reference

ASP.NET Web Site Administration

ASP.NET Configuration API