asp.net 2 sexual configuration (profile)
Store configuration information for each user
Strong type long-term save support for anonymous users
Definition configuration (Profile)
<?xml version= "1.0"?>
<configuration xmlns= "http://schemas.microsoft.com/.NetConfiguration/v2.0" >
<appSettings/>
<connectionStrings>
<add name= "Northwind" connectionstring= "server=localhost;integrated security=true;database=northwind" Providername= "System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<anonymousidentification enabled= "true"/>
<profile>//Definition configuration (Profile)
<properties>
<add name= "Theme" allowanonymous= "true"/>
<add name= "lastvisit" type= "System.DateTime" allowanonymous= "true"/>
</properties>
</profile>
<!--
<webParts>//Definition configuration (WebParts)
<personalization defaultprovider= "Aspnetsqlpersonalizationprovider"/>
</webParts>
-->
<!--
Set compilation debug= "true" to insert debugging symbols into the compiled page.
Because this affects performance, the set this value to true only during development.
-->
<compilation debug= "true" >
<expressionBuilders>
<add expressionprefix= "Version" type= "Versionexpressionbuilder"/>
</expressionBuilders>
</compilation>
<!--
The <authentication> section enables configuration of the security authentication
Mode used by ASP.net to identify a incoming user.
-->
<authentication mode= "Windows"/>
<!--
The <customErrors> section enables configuration of what to did if/when an unhandled
Error occurs during the execution of a request. Specifically, it enables developers
To configure HTML error pages to is displayed in place of a error stack trace.
-->
<customerrors mode= "RemoteOnly" defaultredirect= "genericerrorpage.htm" >
<!--
<error statuscode= "403" redirect= "noaccess.htm"/>
<error statuscode= "404" redirect= "filenotfound.htm"/>
-->
</customErrors>
</system.web>
</configuration>
Use configuration (Profile)
Increment the current user ' s post cout
Profile.posts = profile.posts+1;
Update the current user "s Last Post Date
Profile.lastpost = DateTime.Now;
Personalization data will be stored in the database
Introduced
Microsoft asp.net 2.0 supports a new object called Profile, which automatically stores user information between access to multiple Web applications. A user profile can store various types of information that can be either simple string and integer types or complex custom types. For example, you can store the user's last name, shopping basket, user attributes, or site usage statistics.
In this article, you will learn how to define user profile in an application. We will also show you how to configure profile with different provider. Finally, you will learn how to manage and generate user profile reports.
User Profiles commanding
The profile object is very similar to the session object, but is better used. The similarity to the session is that profile is relative to a particular user, that is, each Web application user has its own profile object. Unlike the session, the profile object is a persistent object. If you give