|
|
Rank: Devotee
Joined: 8/22/2006 Posts: 72
|
Hi, I have successfully built a registration form, login, email registration confirmation and member profile user controls but i am stuck on one thing. How do you save the updated properties back to the member profile? I can do this with normal nodes using publish but i can only see "save()" as available to use. e.g. Code:protected void ButtonUpdate_Click(object sender, EventArgs e) { if (Page.IsValid) { Member m = Member.GetCurrentMember();
//Update Registration Properties m.getProperty("custFirstName").Value = custFirstName.Text.Trim(); m.getProperty("custSurname").Value = custSurname.Text.Trim(); m.getProperty("custEmail").Value = custEmail.Text.Trim(); m.getProperty("custTel").Value = custTel.Text.Trim(); m.getProperty("addressName").Value = addressName.Text.Trim(); m.getProperty("addressStreet").Value = addressStreet.Text.Trim(); m.getProperty("addressTown").Value = addressTown.Text.Trim(); m.getProperty("addressCounty").Value = addressCounty.Text.Trim(); m.getProperty("addressPostcode").Value = addressPostcode.Text.Trim(); try { m.Save(); } catch { } panel_UpdateForm.Visible = false; message.Text = "Details Updated"; } }
thanks in advance
|
|
 Rank: Addict
Joined: 2/19/2007 Posts: 819 Location: Belgium
|
like this: Code: newMember.getProperty("Company").Value = Company;
Umbraco tips and tricks: http://www.nibble.be - umbraco mvp 08/09 - certified level 1 & 2 professional
|
|
Rank: Devotee
Joined: 8/22/2006 Posts: 72
|
That works when you are adding a new member. i.e. but doesn't seem to work when trying to update the member property once in. Code: Member m = Member.MakeNew(custFirstName.Text.Trim(), custEmail.Text.Trim(), MemberType.GetByAlias(_memberTypeAlias), new umbraco.BusinessLogic.User(0));
m.LoginName = username.Text.Trim(); m.Password = password.Text; //Add Registration Properties m.getProperty("custFirstName").Value = custFirstName.Text.Trim(); m.getProperty("custSurname").Value = custSurname.Text.Trim();
any thoughts?
|
|
 Rank: Addict
Joined: 2/19/2007 Posts: 819 Location: Belgium
|
works fine for me ... don't see what could be wrong
Umbraco tips and tricks: http://www.nibble.be - umbraco mvp 08/09 - certified level 1 & 2 professional
|
|
 Rank: Addict
Joined: 2/19/2007 Posts: 819 Location: Belgium
|
Only difference I see is that I did'nt supply the email in the makenew method, but that couldn't be the problem ... Code:
Member newMember = Member.MakeNew(Company + " - " + FName + " " + LName + "(" + count.ToString()+ ")", importUserType, new umbraco.BusinessLogic.User(0));
newMember.Email = email;
newMember.getProperty("Company").Value = Company; newMember.getProperty("FName").Value = FName; newMember.getProperty("LName").Value = LName;
Umbraco tips and tricks: http://www.nibble.be - umbraco mvp 08/09 - certified level 1 & 2 professional
|
|
Rank: Devotee
Joined: 8/22/2006 Posts: 72
|
Thanks for the quick reply, i thought i was going mad. It was the post back event that was resetting the fields. simple. thanks again!
|
|
|
Guest |