Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Programmaticly update a user profile...How To?Programmaticly update a user profile...How To?
Previous
 
Next
New Post
1/31/2007 4:34 PM
 

I am trying to programmatically add properties (and their values) to a user profile, but it does not appear that the it is saved to the database... Here is the code I am using, hopefully someone can point out what I am missing or a best practice on this subject... TIA

 

 piUser.Profile.SetProfileProperty("ExtraInfo", ExtraInfo)

 

If ProfileController.ValidateProfile(intPortalId, piUser.Profile) Then

SetApplicationName(piUser.PortalID)

 ProfileController.UpdateUserProfile(piUser, piUser.Profile.ProfileProperties)

End If

 
New Post
1/31/2007 4:45 PM
 
Oh yeah and wanted to mention, I can add property definitions successfully (verified that they are in the ProfilePropDef table) but there are no entries in either the aspnet_Profile table or the (dnn) Profile table...
 
New Post
1/31/2007 5:00 PM
 

First - dnn no longer uses the aspnet_Profile table.

Second - the dnn Profile table is used for Personalization which is a different kind of "profile" - it saves things like whether you are using the Text Editor in Rich Text or PLain Text.

The dnn Table that stored the Profile is UserProfile.

This stores the UserID/ProfileDefinitionID and Profile Value.

So to programmatically use the profile - you need to create a Profile Definition (you can do this programmatically using ProfileController.AddPropertyDefinition().   You can then use the SetProfile method you mentioned above using a "name" that matches the property Definition you created.

Using SetProfile where the PropertyDefinition has not been created does nothing.


Charles Nurse
Chief Architect
Evoq Content Team Lead,
DNN Corp.

Want to contribute to the Platform project? - See here
MVP (ASP.NET) and
ASPInsiders Member
View my profile on LinkedIn
 
New Post
1/31/2007 8:15 PM
 

I had previously added the profile definition and have verified that the value is set before calling the update method. Am I using the correct methods to update the profile? I believe I have everything working up to the point that the data is stored in the database.  I can include more of a code snippet if needed.

Thank you for your help and the quick response!

 
New Post
4/3/2007 11:08 AM
 
Have you ever gotten this to work. I have the same issue.
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Programmaticly update a user profile...How To?Programmaticly update a user profile...How To?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out