O'Reilly logo

ASP.NET 2.0: A Developer's Notebook by Wei-Meng Lee

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Save Anonymous User Profiles

Note

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).

How do I do that?

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.

  1. 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.

    Saving the images in the Images folder

    Figure 7-12. Saving the images in the Images folder

  2. Now we need to create a test page. Add a new ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required