Hi All,
I'm trying to add a page to allow the user to update their information. I basically stripped down the registration webpart example and grabbed the user information in SetupControl() and placed in the page text fields.
Then, under btnOK_Click() I create a userInfo from the current user and assign the values from the page text fields. Finally, I perform a UserInfoProvider.SetUserInfo(), but it does not update the fields in the database. Here is a snippet below, I followed the exam in the documentation, so I'm at a lost of why it does not update the fields.
Thanks,
Craig.
v5.5R2
protected void btnOK_Click(object sender, EventArgs e)
{
#region "User properties"
UserInfo ui = CMSContext.CurrentUser;
if (ui != null)
{
ui.Email = txtEmail.Text.Trim();
ui.FirstName = txtFirstName.Text.Trim();
ui.FullName = txtFirstName.Text.Trim() + " " + txtLastName.Text.Trim();
ui.LastName = txtLastName.Text.Trim();
// PDI custom fields added in CMS.user table...
ui.SetCompanyName(txtCompany.Text);
ui.SetAddress1(txtAddress1.Text);
ui.SetAddress2(txtAddress2.Text);
ui.SetCity(txtCity.Text);
ui.SetState(txtState.Text);
ui.SetCountry(txtCountry.Text);
ui.SetZipcode(txtZipcode.Text);
ui.SetValue("Phone", txtPhone.Text.Trim());
ui.SetValue("Fax", txtFax.Text.Trim());
if (txtMembership.SelectedValue.Trim() == "")
ui.SetValue("Membership", "None");
else
ui.SetValue("Membership", txtMembership.SelectedValue.Trim());
// Store to DB
UserInfoProvider.SetUserInfo(ui);
}
else
Response.Redirect("/Error.aspx");
#endregion
lblError.Visible = false;
Response.Redirect("/Home.aspx");
}
#endregion
protected void btnSkip_Click(object sender, EventArgs e)
{
Response.Redirect("/Home.aspx");
}
}