Partager via


remove Element for group for profile (ASP.NET Settings Schema)

Removes a property from the user profile property group.

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

<remove name="property name" />

Attributes and Elements

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

Attributes

Attribute Description

name

Required String attribute.

Specifies the name of the property definition to remove from the collection.

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.

profile

Configures the user profile for an application.

properties

Defines a collection of user profile properties and property groups.

group

Defines a grouping of user profile properties.

Remarks

For information about accessing and modifying configuration values for the profile element in application code, see ProfileSection.

Example

The following example Web.config file specifies a user profile that contains group of properties with a group name of Address. The properties in the Address group are removed before being added to make sure that the property definitions from this configuration are used. For information about the user profile and an example of setting and reading user profile property groups, see ASP.NET Profile Properties.

<configuration>
   <connectionStrings>
       <add name="SqlServices" connectionString="Data Source=localhost;Integrated Security=SSPI;Initial 
            Catalog=aspnetdb;" />
   </connectionStrings>

  <system.web>
      <authentication mode="Forms" >
        <forms loginUrl="login.aspx"
             name=".ASPXFORMSAUTH" />
      </authentication>

       <authorization>
          <deny users="?" />
       </authorization>

      <membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="15">
        <providers>
          <clear />
          <add 
            name="SqlProvider" 
            type="System.Web.Security.SqlMembershipProvider" 
            connectionStringName="SqlServices"
            enablePasswordRetrieval="false"
            enablePasswordReset="true"
            requiresQuestionAndAnswer="true" 
            requiresUniqueEmail="false"
            passwordFormat="Hashed"
            applicationName="MyApplication" />
        </providers>
      </membership>

      <profile defaultProvider="SqlProvider">
        <providers>
          <add
            name="SqlProvider"
            connectionStringName="SqlServices"
            applicationName="MyApplication"
            type="System.Web.Profile.SqlProfileProvider" />
        </providers>

        <properties>
          <add name="ZipCode" />
          <group name="Address">
             <remove name="Street" />
             <remove name="City" />
             <remove name="State" />
             <remove name="CountryOrRegion" />
             <add name="Street" />
             <add name="City" />
             <add name="State" />
             <add name="CountryOrRegion" />
          </group>
        </properties>
      </profile>
   </system.web>
</configuration>

Element Information

Configuration section handler

System.Web.Configuration.ProfileSection

Configuration member

System.Web.Configuration.SystemWebSectionGroup.Profile

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 2005

See Also

Tasks

How to: Lock ASP.NET Configuration Settings

Reference

group Element for properties for profile (ASP.NET Settings Schema)
profile Element (ASP.NET Settings Schema)
system.web Element (ASP.NET Settings Schema)
<configuration> Element
remove Element for group for profile (ASP.NET Settings Schema)
ProfileSection
System.Web.Configuration
System.Configuration

Concepts

ASP.NET Configuration Overview
ASP.NET Web Server Controls and Browser Capabilities
Securing ASP.NET Configuration
ASP.NET Configuration Scenarios

Other Resources

ASP.NET Profile Properties
ASP.NET Configuration Files
ASP.NET Configuration Settings
General Configuration Settings (ASP.NET)
ASP.NET Configuration API