Click to Rate and Give Feedback

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework General Reference
properties Element for profile (ASP.NET Settings Schema)

Defines a collection of user profile properties and property groups.

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

<configuration> Element
  system.web Element (ASP.NET Settings Schema)
    profile Element (ASP.NET Settings Schema)
      properties Element for profile (ASP.NET Settings Schema)
<properties>
    <add... />
    <clear />
    <remove... />
    <group>...</group>
</properties>

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

Attributes

None.

Child Elements

Element

Description

add

Optional element.

Adds a property to the user profile.

clear

Optional element.

Clears all previously defined properties from the user profile.

group

Optional element.

Defines a grouping of user profile properties.

remove

Optional element.

Removes a property from the user profile.

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.

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

The following example Web.config file specifies a user profile that contains ZipCode property of type string and a RecentSearchList property of type StringCollection. The generated Profile will have strongly typed accessors for each of the specified properties. For information about the user profile and an example of setting and reading user profile properties, see ASP.NET Profile Properties Overview.

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

  <system.web>
   <anonymousIdentification enabled="true" />

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

     <properties>
       <add name="ZipCode" allowAnonymous="true" />
       <add name="RecentSearchList"
            type="System.Collections.Specialized.StringCollection"
            serializeAs="Xml"
            allowAnonymous="true" />
      </properties>
    </profile>
   </system.web>
</configuration>

Configuration section handler

ProfileSection

Configuration member

SystemWebSectionGroupProfile()()()

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

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker