1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Updating Profile Records Programmatically OUTSIDE the Site

Updating Profile Records Programmatically OUTSIDE the Site

2 posts, 0 answered
  1. Armysniper
    Armysniper avatar
    126 posts
    Registered:
    03 Mar 2005
    22 Oct 2009
    Link to this post
    My site utilizes WCF services to enable our external tools to access and change user records and more from our Site Finity site. How can I programmatically get access to the profile records and more importantly how can I get records for a specific user. I looked at ProfileBase but it only allows you to create new records, I need to accesss an existing user's record.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    22 Oct 2009
    Link to this post
    Hi Armysniper,

    You can use Profile.GetProfile method.

    ProfileCommon profile = Profile.GetProfile("username");
    string FN = (string)profile.GetPropertyValue("FirstName");
    if (String.IsNullOrEmpty(FN))
    {
        profile.SetPropertyValue(FN, "UserFirstName");
        profile.Save();
    }

    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
2 posts, 0 answered