Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jesper Ødum Nielsen 2 posts 22 karma points
    Mar 24, 2010 @ 14:50
    Jesper Ødum Nielsen
    0

    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?

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Mar 24, 2010 @ 15:50
    Dirk De Grave
    0

    time for some good old debugging... set a breakpoint on 

    m.getProperty("address").Value = addressBox.Text;

    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

     

  • Jesper Ødum Nielsen 2 posts 22 karma points
    Mar 24, 2010 @ 16:44
    Jesper Ødum Nielsen
    0

    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.

  • Julius Bartkus 51 posts 76 karma points
    Mar 26, 2010 @ 16:10
    Julius Bartkus
    0

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

  • Julius Bartkus 51 posts 76 karma points
    Mar 26, 2010 @ 17:00
    Julius Bartkus
    1

    I found it:

    Member m = new Member(MemberID);
    m.Text = "new name";

Please Sign in or register to post replies

Write your reply to:

Draft