Download presentation
Presentation is loading. Please wait.
Published byGwendoline Bradford Modified over 8 years ago
1
Personalizing Web Sites Nasrullah
2
Understanding Profile The ASP.NET application service that enables you to store and retrieve information about users to your site
3
Continued You access the information in a user’s 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 the Profile feature takes care of the rest. All interaction with the database to retrieve or store profile information in the database is handled automatically for you.
4
Enabling profile 1. Define the information you want to store for a user in the web.config file. Based on this information, the ASP.NET runtime generates and compiles a class for you on the fly that gives you access to the properties you defined. It then dynamically adds a property called Profile to the pages in your web site, so you can easily access it from every page in your site. 2. In your application you program directly to this generated class to get and store the profile information for the current user.
5
Configuring profile Because data about the logged-in user is stored in a cookie by default, your users need to have browsers that support cookies for the ASP.NET Profile feature to work correctly.
6
Configurnig a profile You define a profile for your web site in the web.config file by creating a element as a direct child of the element. Between the tags you need to create a element that is used to define the properties you want to expose from your Profile object. Two types of properties exist: simple properties and complex properties, referred to as profile groups.
7
Configuring a profile... </profile
8
Attributes of element
9
Configuring profile When you define profile properties in web.config, the ASP.NET runtime creates a class for you in the background. This class, called ProfileCommon,gives you access to the strongly typed properties such as FirstName, LastName, and FavoriteGenres. The ProfileCommon class is then made accessible to the Page through its Profile property
10
Reading from profile Reading from the profile is just as easy; all you need to do is access one of its properties FirstName.Text = Profile.FirstName; PostalAddressStreet.Text = Profile.PostalAddress.Street;
11
ASP.NET Profile provider The ASP.NET provider responsible for storing and retrieving profile related data
12
Anonymous identification The ASP.NET feature that enables you to track users to your site, even if they haven’t signed up for an account or are not logged in
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.