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.0Access to ReadOnly DotNetNuke.Entities.Profile.ProfileProperties()Access to ReadOnly DotNetNuke.Entities.Profile.ProfileProperties()
Previous
 
Next
New Post
3/18/2008 6:20 PM
 

So I have 2 questions

These are the facts that I've gathered:

UserProfile.ProfileProperties( ) is ReadOnly
UserProfile.ProfilePropertyAccess does not have a way to modify a ProfilePropertyDefinition for a given UserInfo

Ah... here's something interesting UserProfile.SetProfileProperty(String, String)

My question:

Maybe this first one is silly.  1.  Suppose we have user As UserInfo and definition As ProfilePropertyDefinition (assume they are not null)

Can I call user.ProfileProperites.Add(definition)  even though ProfileProperties is ReadOnly? 

2.  Does UserProfile.SetProfileProperty(String, String) create the property if it does not exist?   

I promise I'll write some documentation for this stuff once I figure out what's going on.

Cheers.

 

 
New Post
3/18/2008 7:00 PM
 

1. Yes  - this is the standard pattern when exposing collection properties, as user.profileProperties "reads" the collection, and now that you have a reference to the collection you can call the collections "add" method.

2. No

 


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
3/18/2008 8:33 PM
 

Perfect.   Thanks for your help.

 
New Post
3/20/2008 10:12 AM
 

Funny that you posted about this, I just discovered the same thing two days ago. Just for reference; 

You CAN change the Profile Properties using SetProfileProperty as such:

objUser.Profile.SetProfileProperty("propertyname", "your new value");

Then, to update the db;

ProfileController.UpdateUserProfile(objUser); 

 I just wanted to put this out there because I searched for a long time before I came up with it.

 

 

 

 

 
New Post
3/20/2008 10:13 AM
 

Funny that you posted about this, I just discovered the same thing two days ago. Just for reference; 

You CAN change the Profile Properties using SetProfileProperty as such:

objUser.Profile.SetProfileProperty("propertyname", "your new value");

Then, to update the db;

ProfileController.UpdateUserProfile(objUser); 

 I just wanted to put this out there because I searched for a long time before I came up with it.

 

 

 

 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Access to ReadOnly DotNetNuke.Entities.Profile.ProfileProperties()Access to ReadOnly DotNetNuke.Entities.Profile.ProfileProperties()


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