Accessing other members profile properties

G

Guest

I have an important question. How would I access profile information on
another member? Exaple: John and Sue are both members of an aplpication, but
when john is logged in he needs to see Sue's contact # which is stored in her
profile data. How would I write code to acees another members profile
information. Please help, thanks in advance.
 
P

PeterKellner

I have an important question. How would I access profile information on
another member? Exaple: John and Sue are both members of an aplpication, but
when john is logged in he needs to see Sue's contact # which is stored in her
profile data. How would I write code to acees another members profile
information. Please help, thanks in advance.

Here is an example with specifying the username of the person you are
looking for.

MembershipUser mu = Membership.GetUser(userName);

ProfileCommon pc =
(ProfileCommon)ProfileBase.Create(mu.UserName, true);
pc.FirstName = firstName;
pc.LastName = lastName;
pc.AdvancedMode = advancedMode;
pc.Address.Street = address_Street;
pc.Address.City = address_City;
pc.Address.State = address_State;
pc.Address.Zip = address_Zip;

(this is from my Profile Viewer article that automatically generates
an ObjectDataSource that lets you show all users profile info. It is
at http://peterkellner.net/?p=29 . In theory, this should be on MSDN
soon. Keeping my fingers crossed)
Peter Kellner
http://peterkellner.net
 
G

Guest

That helps. Thanks a lot!
--
Jesse Johnson


PeterKellner said:
Here is an example with specifying the username of the person you are
looking for.

MembershipUser mu = Membership.GetUser(userName);

ProfileCommon pc =
(ProfileCommon)ProfileBase.Create(mu.UserName, true);
pc.FirstName = firstName;
pc.LastName = lastName;
pc.AdvancedMode = advancedMode;
pc.Address.Street = address_Street;
pc.Address.City = address_City;
pc.Address.State = address_State;
pc.Address.Zip = address_Zip;

(this is from my Profile Viewer article that automatically generates
an ObjectDataSource that lets you show all users profile info. It is
at http://peterkellner.net/?p=29 . In theory, this should be on MSDN
soon. Keeping my fingers crossed)
Peter Kellner
http://peterkellner.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top