Technical Training
ASP.NET 2.0Table of Contents
ASP.NET Personalization: User Profiles and Themes
ASP.NET Personalization: User Profiles and Themes - Page 2ASP.NET Personalization: User Profiles and Themes Page - 2
ASP.NET Personalization: User Profiles and Themes
Creating a Shopping cart application with Personalization features:
A shopping cart application has to have two classes—Cart and Product. The Cart derives from System.Collections.Generic.List class and Product is a business object prototype with some attributes. Both classes must be marked as Serializable.
1. Create a Website project and add an Application_code directory to the Web site.
2. Right click on this directory and select “Add New Item…” and select class.
3. Name the class file Cart.cs and click Add.
4. Note that a new class file has been created for your project.
5. Enter the following code in the Cart.class file.
Click here to view sample code
6. Now create another class file called Product.cs and enter the following code in it.
Click here to view sample code
7. Now create a web.config file and enter the following code.
< personalization >
< profile >
< add name="Cart" type="Cart" SerializeAs="Xml" / >
< / profile >
< / personalization >
8. An objectDataSource control will now have to be used to access the basket. Open a .aspx file and enter the following code to use the shopping cart. The page will contain a GridViewControl and a DetailsView control. The former will help users show, edit and delete the contents of the cart and the latter will help adding of new items.
Click here to view sample code
9. The design view of the Shopping cart application would look as under:

10. Now create a CartManager class and type in the following code
Click here to view sample code
11. Save all and click F5 to execute.
In this section of the tutorial we have seen how to use personalization to store the profile of the user and also to save the features personalized by users. Complex features and data structures can also be stored by users with personalization as we have seen in the shopping cart application above. In the next section we shall look at Themes and skins which are closely associated with personalization and is often used with it.
ASP.NET 2.0
- Getting started with ASP.NET 2.0
- .NET Framework Fundamentals
- Microsoft.NET Framework Tools
- Application Development in .NET
- What's New in the .NET Framework 2.0 ?
- Introduction to Visual Studio.NET
- Installing Visual Studio.NET 2005
- Working with Visual Studio.NET Web Applications
- Whats New in ASP.NET 2.0
- Creating an ASP.NET Application
- ASP.NET Code Directory
- ASP.NET Page Object Model
- ASP.NET Server Controls
- ASP.NET Working With Master Pages
- ASP.NET Creating Content for Master Page
- ASP.NET Referencing Master Page Members
- ASP.NET Changing Master Pages Dynamically
- ASP.NET Creating Nested Master Pages
- ASP.NET Working with Web Parts
- ASP.NET Using Web Parts and Controls in Web Pages
- ASP.NET Web Pages and Layout
- ASP.NET - Adding Web Parts at Run Time
- ASP.NET Personalization: User Profiles and Themes
- ASP.NET Data Access features
- ASP.NET State Management
- ASP.NET Customizing the Session State Mechanism
- ASP.NET State Management And Caching
- ASP.NET Security
- Forms Authentication in ASP.NET
- ASP.NET Managing Membership and Roles
- ASP.NET Configuring Page-Level Caching
- ASP.NET Setting Application-Level Caching
- ASP.NET Data Source Object Model
- ASP.NET SqlDataSource Control
- ASP.NET Data Bound Controls
- ASP.NET GridView Control
- ASP.NET GridView Filtering
- ASP.NET Adding Sorting and Paging in GridView
- ASP.NET DataBound Controls - Details View
- ASP.NET Using a Grid to Display Detail Information
- ASP.NET Displaying Master-Detail Data on the Same Page
- Displaying Master-Detail Data on Separate Pages in ASP.NET
- ASP.NET Creating Web Wizards
- ASP.NET : Dynamic Image control
- ASP.NET Advanced Site Functionality







