More in this section

Forums / Developing with Sitefinity / Programmatically set drop down field value of profile not saved

Programmatically set drop down field value of profile not saved

1 posts, 0 answered
  1. John
    John avatar
    1 posts
    Registered:
    19 Jun 2012
    19 Jun 2012
    Link to this post
    Hi everybody,

    I have an issue that programmatically set drop down value of profile not saved, I created 'Contact Us' Profile Type and created Contact Us Form, the field 'Enquiry' is drop down of 'Contact Us' profile type. When I filled in contact us form and submitted then I go to admin check the user that Enquiry is not what I selected and select default value. see below code:
      var profilemgr = UserProfileManager.GetManager();
      var prf = profilemgr.CreateProfile(user, "Telerik.Sitefinity.Security.Model.contactus");
                                Telerik.Sitefinity.Model.DataExtensions.SetValue(prf, "ContactPhone", contact_phone);
                                Telerik.Sitefinity.Model.DataExtensions.SetValue(prf, "Comment", comment);
                                Telerik.Sitefinity.Model.DataExtensions.SetValue(prf, "Enquiry", enquiry);
                                profilemgr.SaveChanges();
1 posts, 0 answered