Copied to clipboard

Flag this post as spam?

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


  • Alexander 23 posts 73 karma points
    Feb 05, 2014 @ 01:38
    Alexander
    0

    Updating Member's property problem

    Hi everyone

    I'm trying to create member with this code:

    Code:

    var user = Membership.CreateUser(username: model.Email,
                                password: Membership.GeneratePassword(10, 0),
                                email: model.Email);
                            var member = uQuery.GetMember((int)Membership.GetUser(model.Email).ProviderUserKey);
                            var confirmationToken = Guid.NewGuid().ToString().Replace("-", "");
                            member.Email = model.Email;
                            member.AddGroup(MemberGroup.GetByName("Common Member"));
                            member.getProperty("whyMe").Value = model.WhyMe;
                            member.getProperty("isActivated").Value = false;
                            member.getProperty("isAnonymous").Value = true;
                            member.getProperty("confirmCode").Value = confirmationToken;
                            member.Save();

    It work's OK.

    But after that I call another mvc action where I try to set few true/false properties:

    Code:

    var user = Membership.GetUser(email);
                var member = uQuery.GetMember((int) user.ProviderUserKey);
                member.SetProperty("isActivated", true);
                member.SetProperty("isConfirmed", true);
                member.SetProperty("isEmailConfirmed", true);
                member.Save();

    It doesn't throw any exception and it doesn't save data for this member. I also tried to use member.getProperty("isActivated").Value = false;

    but it also didn't work.

    Is anybody have thoughts what can be wrong with it?

     

Please Sign in or register to post replies

Write your reply to:

Draft