ProfileGroupBase Constructor
Creates an instance of the ProfileGroupBase class.
Assembly: System.Web (in System.Web.dll)
ASP.NET uses the ProfileGroupBase class to create grouped properties in the Profile property for the current HttpContext. When properties are specified as a group of properties using the group Element for properties for profile (ASP.NET Settings Schema) element, ASP.NET creates a new class with strongly typed accessors for each property in the group. The new class inherits the ProfileGroupBase base class.
This class is not intended to be created from your code.
The following Web.config file specifies a user profile that contains a group of properties with a group name of Address. The grouped properties generated for the Profile property of the current HttpContext will be preceded by the group name, for example, Profile.Address.Street.
<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 enabled="true" 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>
The following ASP.NET page reads and sets the grouped properties specified for the user profile.
Security Note: |
|---|
This example contains a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see Script Exploits Overview. |
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Security Note: