Introduced
The storage User Configuration feature in ASP.net 2.0 allows you to define and store the user-based settings that you want to use throughout your application. Also, when users are not logged in, these settings can be stored in an anonymous configuration file and then migrated to the user's profile at some point in the future.
The essential
1, configuration <system.web> elements of the <profile> elements; If you need to support anonymity, you will also need to configure the <anonymousidentification under <system.web> elements > elements. Examples are shown below, for illustration only
<profile enabled= "true" defaultprovider= "SqlProfileProvider" inherits= "Customprofile" > <providers > <add name= "SqlProfileProvider" type= "System.Web.Profile.SqlProfileProvider, system.web, version=2.0.3600.0, Culture=neutral, publickeytoken=b03f5f7f11d50a3a "connectionstringname=" sqlConnectionString "ApplicationName = "/"/> </providers> <properties> <add name= "name"/> <add name= "Color" type= "System . Drawing.color "/> <group name=" group "> <add name=" Collection "type=" System.Collections.ArrayList "/&G
T
<add name= "Price" type= "int" defaultvalue= "M"/> </group> </properties> </profile> <anonymousidentification enabled= "true" cookiename=.
Vs2005_anonymous "cookietimeout=" 1440 "cookiepath="/"cookierequiressl=" false "cookieslidingexpiration=" true " cookieprotection= "All" cookieless= "usecookies"/>
Detailed descriptions of each attribute refer to MSDN, index find "profile element" and "anonymousidentification element"