I am using Umbraco 4.0.3 and ASP.NET 3.5 in Windows 7
I have wioth succes created members in Umbraco, even with custom made information like address and city. But I want the members of my site to be able to update their informations, in case they move to another city. But I can't make it work. It won't seem to update my member informations.
I use this code:
Member m = Member.GetCurrentMember();
m.getProperty("address").Value = addressBox.Text;
m.Save();
and it won't update my my current members address.
It turned out to be much simpler. It actually all worked, but I was loading the page just before each click. So all the data I had changed got changed back into the same thing it alreaddy was.
I changed that by adding a Page.IsPostBack, so I only load the data once, and not all the time I load the page.
How to update member informations?
I am using Umbraco 4.0.3 and ASP.NET 3.5 in Windows 7
I have wioth succes created members in Umbraco, even with custom made information like address and city. But I want the members of my site to be able to update their informations, in case they move to another city. But I can't make it work. It won't seem to update my member informations.
I use this code:
Member m = Member.GetCurrentMember();
m.getProperty("address").Value = addressBox.Text;
m.Save();
and it won't update my my current members address.
Can anybody help me?
time for some good old debugging... set a breakpoint on
and check with sql profiler if there's actually a db call when executing this line of code.
(Yup, a db call is made for each property setter, so m.Save() won't do much more)
Other checks: is variable m not null and do you have a property with alias "address" (stupid questions, but you never know)
Let us know what you find out.
Cheers,
/Dirk
It turned out to be much simpler. It actually all worked, but I was loading the page just before each click. So all the data I had changed got changed back into the same thing it alreaddy was.
I changed that by adding a Page.IsPostBack, so I only load the data once, and not all the time I load the page.
How can I change Member node name?
I can see that it is just possible to get the name of the node, but not changing it.
Node n = new Node(MemberID);
String name = n.Name;
or
name = library.GetMemberName(MemberID);
I found it:
Member m = new Member(MemberID);
m.Text = "new name";
is working on a reply...