Skip to Content
Beginning ASP.NET 3.5: In C# and VB
book

Beginning ASP.NET 3.5: In C# and VB

by Imar Spaanjaars
March 2008
Intermediate to advanced content levelIntermediate to advanced
766 pages
21h 15m
English
Wrox
Content preview from Beginning ASP.NET 3.5: In C# and VB

16.1. Understanding Profile

The ASP.NET Profile is another application service that ships with ASP.NET. It enables you to store and retrieve information about users to your site that goes beyond basic information like an e-mail address and password that users can enter during sign-up, as you learned in the previous chapter. With Profile, you can store information like a first and last name, a date of birth, and much more, as you'll see later in this chapter. By keeping track of the user that the data belongs to, ASP.NET is able to map that data to a user the next time she visits your site, whether that be minutes or weeks later. The cool thing about Profile is that it allows you to store data for registered users as well as anonymous users. So, even if your visitors haven't signed up for an account, you can recognize them and store information about them.

You access the properties of the Profile through a clean API with virtually no code. All you need to do is define the information you want to keep track of in the central web.config file and then the Profile feature takes care of the rest. All interaction with the database to retrieve or store the profile information in the database is handled automatically for you.

Enabling Profile in your web application is a simple, three-step process:

  1. Define the information you want to store for a user in the web.config file.

  2. Based on this information, the ASP.NET runtime generates and compiles a class for you on the fly that gives you access ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning ASP.NET 4: in C# and VB

Beginning ASP.NET 4: in C# and VB

Imar Spaanjaars
Professional ASP.NET 3.5 SP1 Edition: In C# and VB

Professional ASP.NET 3.5 SP1 Edition: In C# and VB

Bill Evjen, Scott Hanselman, Devin Rader

Publisher Resources

ISBN: 9780470187593Purchase book