Copied to clipboard

Flag this post as spam?

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


  • aaeda 113 posts 146 karma points
    Sep 11, 2014 @ 14:52
    aaeda
    0

    Update Members Programatically

    Hi

    I would to know if it is possible to update the 'Login' of an existing member programmatically.

    Can you please advise? Thanking you in advance for your help.

    Regards

  • MK 426 posts 902 karma points
    Sep 11, 2014 @ 15:04
    MK
    0

    Try this:

     

                var member = Services.MemberService.GetByEmail("[email protected]");

                member.SetValue("prop", "value");

                Services.MemberService.Save(member, true);

  • aaeda 113 posts 146 karma points
    Sep 12, 2014 @ 08:00
    aaeda
    0

    thanks for your reply. Will give it a try and let you know how it goes.

  • aaeda 113 posts 146 karma points
    Sep 12, 2014 @ 11:32
    aaeda
    0

    Hi I forgot to mention that I am using version 4.7 of umbraco. I don't have the appropriate dlls in that version. So what I did is update the table for members directly by an SQL query.

    Thanks a lot

  • MK 426 posts 902 karma points
    Sep 12, 2014 @ 11:41
    MK
    0

    Try this:

    http://our.umbraco.org/wiki/reference/api-cheatsheet/working-with-members

                 Member m = Member.GetCurrentMember();

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

                m.Save();

  • MK 426 posts 902 karma points
    Sep 12, 2014 @ 11:43
    MK
    0

    How come you are working with 4.7?

    If it is not a big site I will recommend to upgrade.

     

  • aaeda 113 posts 146 karma points
    Sep 18, 2014 @ 08:40
    aaeda
    0

    Hi

    Thanks for your replies. The site is actually quite big and is has been done quite some years back that's why it is still 4.7.

    Regards

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies