[ Download sample code ]
This is the first article in a series of articles on the new ASP.NET personalization feature, the Profile object. To start with we will explain what the Profile object is and how it differs from the Session object, and then provide simple examples of a Profile object with simple properties and a Profile object with group properties.
To appreciate the value of the Profile object, we need to recognise that there is a common requirement to store user-specific information for the period the user is visiting a web application. In ASP.NET 1.1 we used the Session object. That object has many limitations compared to the new Profile object provided by ASP.NET 2.0. Presently we will compare the Session object and the Profile object. For the moment, we can understand that a Profile object allows the application to store data for each visitor to the web application, save that data to a storage medium like Microsoft SQL Server, and then retrieve the data when the same visitor returns to the application. It has this nice facility of storing profiles not only for authenticated users, but also for anonymous users.
So you might be asking yourself, why would we use the new Profile object when we have the existing Session object? The coming sections of this article will explain how the new Profile object is more flexible and easier to use than the Session object.