Here is the fun part: the code :)
using(SPSite site = new SPSite(http://Site_URL/))
{using(SPWeb web = site.OpenWeb())
{
ServerContext context = ServerContext.GetContext(site);
UserProfileManager profMgr = new UserProfileManager(context);
string acc = @"domaniname\loginname";
UserProfile profile = profMgr.GetUserProfile(acc);
profile["AboutMe"].Value = (String.IsNullOrEmpty(txtPropValue.Text)) ? "property_value" : txtPropValue.Text;
profile.Commit();
}
}
Happy Coding!!!
No comments:
Post a Comment