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

Forums / Developing with Sitefinity / Set user FirstName not working

Set user FirstName not working

1 posts, 0 answered
  1. Liviu
    Liviu avatar
    6 posts
    Registered:
    03 Aug 2012
    12 Sep 2012
    Link to this post
    string username = Request["username"];
                UserManager userManager = UserManager.GetManager();
                UserProfileManager profileManager = UserProfileManager.GetManager();


                User user = userManager.GetUsers().Where(u => u.UserName == username).SingleOrDefault();
                if(user != null)
                {
                    //var profile = profileManager.GetUserProfile<SitefinityProfile>(user);
                    //profile.FirstName = tbFirstName.Text;

                    //UserProfileManager userProfileManager = UserProfileManager.GetManager();
                    //UserProfile profile1 = userProfileManager.GetUserProfile(user.Id, typeof(SitefinityProfile).FullName);
                    //Telerik.Sitefinity.Model.DataExtensions.SetValue(profile1, "FirstName", "FirstName");
                    
                    user.Email = tbEmail.Text; //works!
                    userManager.SaveChanges();
                }
    None of commented methods work. Wht? Thanks!
1 posts, 0 answered