Copied to clipboard

Flag this post as spam?

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


  • Ahmed 16 posts 96 karma points
    Sep 05, 2013 @ 15:16
    Ahmed
    0

    adding properties to members using C#

    can i add custom properties to members using C# in umbraco 

  • Charles Afford 1163 posts 1709 karma points
    Sep 06, 2013 @ 12:10
  • pat 124 posts 346 karma points
    Sep 06, 2013 @ 15:04
    pat
    0

    yes you can ;

    MemberType mt = MemberType.GetByAlias("name of member type here");

     

    Member m = Member.MakeNew(fullname,mt, new umbraco.BusinessLogic.User(0));

    m.Password = "pwvalue";

    m.Email = "email";

    m.LoginName = "emailorusername;

    //custom property fullName

    m.getProperty("fullName").Value = FirstName.Text + " " + LastName.Text;

     

        m.XmlGenerate(new System.Xml.XmlDocument());

        m.Save();

     

Please Sign in or register to post replies

Write your reply to:

Draft