Copied to clipboard

Flag this post as spam?

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


  • Alex Perotti 53 posts 94 karma points
    Mar 01, 2015 @ 18:36
    Alex Perotti
    0

    u7 Setting member custom properties

    public static Umbraco.Core.Models.IMember RegisterMember(RegistrationViewModel rw)
        {
            var service = ApplicationContext.Current.Services.MemberService;
            var m = service.CreateMemberWithIdentity(rw.Username, rw.Username, rw.Surname + " " + rw.Name, "Member");
            m.IsApproved = false;
            service.SavePassword(m, rw.Password);
            service.AssignRole(m.Id, "Newsletter");
            service.Save(m);
    
            return m;
    

    Here is my code. What I need to do is to set custom property values, but I don't find a way to access the member properties or the Profile Model.

    Any suggestion?

    Thank you

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Mar 02, 2015 @ 12:19
    Jeroen Breuer
    101

    Try this before you use .Save :

    m.SetValue("customPropAlias", value)

    Jeroen

  • Alex Perotti 53 posts 94 karma points
    Mar 02, 2015 @ 22:32
    Alex Perotti
    0

    My bad :/

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Mar 03, 2015 @ 09:19
    Jeroen Breuer
    0

    Could you please mark a post as the solution if it helped you.

    Jeroen

Please Sign in or register to post replies

Write your reply to:

Draft