Mega Code Archive

 
Categories / ASP.Net Tutorial / Profile
 

Inheriting a Profile from a Custom Class

File: App_Code\SiteProfile.cs using System; using System.Web.Profile; public class SiteProfile : ProfileBase {     private string _firstName = "Your First Name";     private string _lastName = "Your Last Name";     [SettingsAllowAnonymous(true)]     public string FirstName     {         get { return _firstName; }         set { _firstName = value; }     }     [SettingsAllowAnonymous(true)]     public string LastName     {         get { return _lastName; }         set { _lastName = value; }     } } File: Web.Config <configuration> <system.web>   <anonymousIdentification enabled="true" />   <profile inherits="SiteProfile" /> </system.web> </configuration>