Copied to clipboard

Flag this post as spam?

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


  • Pete 213 posts 285 karma points
    May 09, 2013 @ 13:41
    Pete
    0

    Member Properties confusion

    I'm creating members manually using the api.

    But I've noticed that I'm unable to set the Text Name of a member.

    I can set the LoginName and Email no problems.

    Is the "Name" field you see on the member properties page an actual settable field? or is it just a repeat of LoginName ?

    //create a member
    System.Web.Security.Membership.CreateUser(member_emailname.Trim(), password, member_emailname.Trim());
    System.Web.Security.Roles.AddUserToRole(member_emailname.Trim(), foldername);
    var member = System.Web.Security.Membership.GetUser(member_emailname.Trim());
    Member m = Member.GetMemberFromLoginName(member_emailname.Trim());

    //set a property value on the member
    m.LoginName = member_emailname.Trim();
    m.SetProperty("Name", member_name); // Doesn't seem to work
    m.SetProperty("Text", member_name); // Doesn't seem to work
    m.Save();
  • Barry Fogarty 493 posts 1129 karma points
    May 09, 2013 @ 14:12
    Barry Fogarty
    100

    Hi Pete,

    Try this:

    m.Text = member_name;
  • Pete 213 posts 285 karma points
    May 09, 2013 @ 14:39
    Pete
    0

    Ha, thanks barry, could have sworn I tried that.

    Pete

Please Sign in or register to post replies

Write your reply to:

Draft