Microsoft Technologies » .Net Framework » ASP.Net

ID #1000

Can I make use of Profile in an independent class rather than the Page?

Yes. You can make use of the Profile from within any code that may not be a codebeside for a page. You really don't need a reference to any Page-derived class. What you work with in codebeside class is the property Profile of type ProfileCommon created once profiles are enabled.

Use the following code to get the profile:

public void WorkWithProfile(string username)
{
ProfileBase profile = ProfileBase.Create(username);
ProfileCommon currentProfile = profile as currentProfile;
}

In addition to this, you may want to customize your profile class. For more detials on how to customize profile entries programmatically, look at the following article in Eduzine©

How to work with custom profile in ASP.Net


Last update: 2007-03-31 11:50
Author: Edujini
Revision: 1.5

Print this record Print this record
Send to a friend Send to a friend
Show this as PDF file Show this as PDF file
Export as XML-File Export as XML-File

Please rate this entry:

Average rating: 5 from 5 (1 Votes )

completely useless 1 2 3 4 5 most valuable

You cannot comment on this entry