group Element for properties for profile (ASP.NET Settings Schema)
Defines a grouping of user profile properties.
This element is new in the .NET Framework version 2.0.
system.web Element (ASP.NET Settings Schema)
profile Element (ASP.NET Settings Schema)
properties Element for profile (ASP.NET Settings Schema)
group Element for properties for profile (ASP.NET Settings Schema)
<group name="group name">
<add... />
<remove./>
</group>
The following sections describe attributes, child elements, and parent elements.
Attributes
Attribute | Description |
|---|---|
name | Required String attribute. The name of the property group. This value is used as the identifier for the automatically generated group profile class. The name of the group cannot contain a period (.). For more information about the automatic generation of user profile properties, see ASP.NET Profile Properties Overview. |
Child Elements
Element | Description |
|---|---|
add | Optional element. Adds a property to the user profile property group. |
remove | Optional element. Removes a property from the user profile property group. |
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. |
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 group of properties with the group name Address. The grouped properties that are generated for the Profile property will be preceded by the group name (for example, Profile.Address.Street). For information about the user profile and an example of setting and reading user profile property groups, see ASP.NET Profile Properties Overview.
<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">
<add name="Street" />
<add name="City" />
<add name="State" />
<add name="CountryOrRegion" />
</group>
</properties>
</profile>
</system.web>
</configuration>