User Profile Question

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
keats76
Commander (CMDR)
Commander (CMDR)
Posts: 117
Joined: Sat Dec 15, 2007 4:45 pm

User Profile Question

Post by keats76 » Tue Apr 01, 2008 4:31 pm

I'm fiddling with the User.Profile because I think it would work well to store custom profile data for the users. For example, let's say your implementation requires that you store the customer's age ... I'd like to create a helper class to allow the application to add an age property to the User.Profile for use in the registration (and or profile display) screens (as well as data mining).

That leads to my question:

When is the User.Profile object instantiated? Or is it currently in use?

When I try to play with the Personalization.Profile.SetPropertyValues method on the User.Profile object I receive a null pointer exception. It looks like the Profile object is not initialized, and there is no setter for the Profile (just a getter) so I can't instantiate one myself.

Any thoughts?

Thanks,
Mike

User avatar
Logan Rhodehamel
Developer
Developer
Posts: 4116
Joined: Wed Dec 10, 2003 5:26 pm

Re: User Profile Question

Post by Logan Rhodehamel » Tue Apr 01, 2008 6:06 pm

It's not used. I think it might even be disabled in our default web.config.

There is a custom field collection for user that you could use. Try User.Settings.SetValueByKey and User.Settings.GetValueByKey. The only restriction is you cannot have multiple fields with the same key.
Cheers,
Logan
Image.com

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.

keats76
Commander (CMDR)
Commander (CMDR)
Posts: 117
Joined: Sat Dec 15, 2007 4:45 pm

Re: User Profile Question

Post by keats76 » Wed Apr 02, 2008 7:29 am

That did the trick. Thanks!

Mike

Post Reply