Copied to clipboard

Flag this post as spam?

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


  • Peter Drayton 29 posts 49 karma points
    Dec 14, 2011 @ 15:29
    Peter Drayton
    0

    Member Properties Question

    Hi,

     

    If I've created a new Member using this method:

                    MembershipUser newMember = Membership.CreateUser(email.Text, email.Text, email.Text);
                    newMember.IsApproved = true;
                    //newMember.getProperty("Marketing").Value = marketing.Checked;
                    Membership.UpdateUser(newMember);

    How do I set a Property which has been created called "Marketing" which is a Checkbox (True/False)?

     

    Many thanks,

     

    Peter.

  • Nigel Wilson 939 posts 2061 karma points
    Dec 14, 2011 @ 20:02
    Nigel Wilson
    0

    Hi Peter

    The following should do the trick !

    newMember.getProperty("Marketing").Value = "1";

    Being a boolean property the values are 0 or 1

    Hope this helps.

    Cheers

    Nigel

  • Peter Drayton 29 posts 49 karma points
    Dec 15, 2011 @ 19:23
    Peter Drayton
    0

    Hi Nigel,

    Thanks for your reply.

    Unfortunately not, the following error:

    'System.Web.Security.MembershipUser' does not contain a definition for 'getProperty' and no extension method 'getProperty' accepting a first argument of type 'System.Web.Security.MembershipUser' could be found (are you missing a using directive or an assembly reference?)

     

    Peter.

  • Nigel Wilson 939 posts 2061 karma points
    Dec 15, 2011 @ 19:45
    Nigel Wilson
    0

    Hi Peter

    Sorry, my bad - I didn't see that you are using "MembershipUser".

    What I was quoting relates to the umbraco.cms.businesslogic.member.Member namespace.

    http://our.umbraco.org/wiki/how-tos/membership-providers provides some detail but I am not totally sure how to implement.

    I will watch this forum with interest to see if others can enlighten.

    In the meantime I might do some further Googling to see if I can track down an answer...

    Nigel

     

  • 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