namespace LD.Sample.BLL { using System; [Serializable] public class Personal { public string FirstName { get; set; } public string LastName { get; set; } // public DateTime DateOfBirth { get; set; } } } namespace LD.Sample.BLL { using System.Web; using System.Web.Profile; public class CustomProfile : ProfileBase { public Personal Personal { get { return (Personal) GetPropertyValue("Personal"); } } /// <summary> /// Get the profile of the currently logged-on user. /// </summary> public static CustomProfile GetProfile() { return (CustomProfile) HttpContext.Current.Profile; } /// <summary> /// Gets the profile of a specific user. /// </summary> /// <param name="userName">The user name of the user whose profile you want to retrieve.</param> public static CustomProfile GetProfile(string userName) { return (CustomProfile) Create(userName); } } }
<profile defaultprovider="LD.SampleWAP.ProfileProvider" inherits="LD.Sample.BLL.CustomProfile"> <providers> <add name="LD.SampleWAP.ProfileProvider"> type="System.Web.Profile.SqlProfileProvider" applicationName="/" connectionStringName="LocalSqlServer" /> </providers> </profile>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)