asp.net 2.0 (C #) (7)

Source: Internet
Author: User

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"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.