Programmatically set drop down field value of profile not sa

Posted by Community Admin on 04-Aug-2018 00:11

Programmatically set drop down field value of profile not saved

All Replies

Posted by Community Admin on 19-Jun-2012 00:00

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();

This thread is closed