You can use the Profile service to store information about anonymous users, instead of an authenticated user ID.
While ASP.NET 2.0 employs a unique user ID to associate a user with a profile, it is often desirable to associate an anonymous user with a profile as well. For example, at a typical e-commerce web site, users who have not yet been authenticated are typically encouraged to add items to their shopping carts while they browse the merchandise. Only when a user is ready to check out is she then required to log into the system and supply other information, such as credit card numbers and a shipping address.
In ASP.NET 2.0, you can keep track of anonymous users through the use of the Globally Unique Identifier (GUID).
In this lab, you will see how you can implement anonymous personalization in ASP.NET 2.0. You will also learn how you can store complex data types into the profile property.
Using the same project created in the last lab (C:\ASPNET20\chap07-Profile), create a new Images folder in your project and add the images as shown in Figure 7-11 (you can download these images from the O'Reilly support site at http://www.oreilly.com/catalog/aspnetadn/). We'll use these images to represent items that can be ordered on our test page.
Figure 7-12. Saving the images in the Images folder
Now we need to create a test page. Add a new ...