| |||||||||||||||||||||||
<profile> SectionASP.NET Syntax ASP.NET Configuration Sections .NET Framework version 2.0 Configures parameters for managing user profile values by using the ASP.NET profile. <profile enabled = "true | false" inherits = "fully qualified type reference" automaticSaveEnabled = "true | false" defaultProvider = "provider name"> <properties>...</properties> <providers>...</providers> </profile> Attributes and ElementsThe following sections describe attributes, child elements, and parent elements. Attributes
Child Elements
Parent Elements
RemarksFor information about accessing and modifying configuration values for the profile element in application code, see ProfileSection. Default ConfigurationThe following default profile element is configured in the Machine.config file in the .NET Framework version 2.0. <profile>
<providers>
<add name = "AspNetSqlProfileProvider"
connectionStringName = "LocalSqlServer"
applicationName = "/"
type = "System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</profile>
ExampleThe following code example shows how to configure the Web.config file for an ASP.NET application to use a SqlProfileProvider provider. <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"
applicationName = "SampleApplication"
enablePasswordRetrieval = "true"
enablePasswordReset = "true"
passwordFormat = "Encrypted"
requiresQuestionAndAnswer = "true" />
</providers>
</membership>
<profile defaultProvider = "SqlProvider">
<providers>
<clear />
<add name = "SqlProvider"
type = "System.Web.Profile.SqlProfileProvider"
connectionStringName = "SqlServices"
applicationName = "SampleApplication"
description = "SqlProfileProvider for SampleApplication" />
</providers>
<properties>
<add name = "ZipCode" />
<add name = "CityAndState" />
</properties>
</profile>
</system.web>
</configuration>
See AlsoASP.NET Configuration ProfileSection Class |
| ||||||||||||||||||||||
Check out related books at Amazon
© 2000-2008 Rey Nuñez All rights reserved.
If you have any question, comment or suggestion
about this site, please send us a note
You can help support aspxtreme