Copied to clipboard

Flag this post as spam?

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


  • bob 19 posts 39 karma points
    Jun 20, 2011 @ 08:34
    bob
    0

    Accessing member name

    Hi,

    How is the member name accessed programmatically? I'm using Umbraco 4.7.

    I have seen some posts related to this but no resolution. Umbraco 4.x is using the .NET membership provider with the Umbraco member deprecated. How do I access and set a member name? It currently seems to be set the same as the member UserName, which is not what I want.

    Where is this documented?

    Thanks.

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jun 20, 2011 @ 09:34
    Dirk De Grave
    0

    bob,

    You can access the member's name using new Member(memberId).Text

     

    Hope this helps.

    Regards,

    /Dirk

     

  • Søren Linaa 255 posts 208 karma points
    Jun 20, 2011 @ 12:42
    Søren Linaa
    0

    Hi Dirk,

    Correct me if I'm wrong, but isn't this the old way of doing it. I'm also wondering how this is done using best practise.

    If I want to create a new user with the asp.net membership api - I can use the following, where Email is also username, but how can I access the name property

    MembershipUser newMember = Membership.CreateUser(Email, password, Email);

     

    / Søren

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jun 20, 2011 @ 13:06
    Dirk De Grave
    0

    @Soren; that's indeed the old way, but the OP was asking for the name, which I think is only stored as part of the "node" info, from which the member node derives... May have read it wrong, thought the OP was after the name in the backend, which is different from the username. GetUser() won't get you any "name", only username. So it depends what the OP is after... Anyway, using the member API should indeed be obsoleted if you're working with members.

     

    Cheers,

    /Dirk

  • Søren Linaa 255 posts 208 karma points
    Jun 20, 2011 @ 13:28
    Søren Linaa
    0

    @Dirk

    You are indeed right - I was just hopping to find a better solution. I guess there is none at the moment

     

    /Søren

  • bob 19 posts 39 karma points
    Jun 21, 2011 @ 02:22
    bob
    0

    Hi all,

    Thanks for the replies.

    Yes, I am after the member 'Name'.

    I create a member (user) via:

    Membership.CreateUser(string username, string password, string email);

    It seems that the member Name is set to the same as the member Login (i.e. the username). However, this is not ideal and I would like to be able to set it independently.

    Unfortunately there does not seem to be much documentation on Umbraco's membership system. What I could fine here:

    http://our.umbraco.org/wiki/how-tos/membership-providers

    essentially points to a collection of msdn articles. But I would like to know how that is working within Umbraco.

    As far as I cal tell, the Umbraco Member class is deprecated and so should not be used. So how do I set a member Name independent of the member Login in Umbraco 4.7?

     

    Thanks.

  • bob 19 posts 39 karma points
    Jun 28, 2011 @ 05:41
    bob
    0

    No joy??

  • Peder Andreasen 5 posts 25 karma points
    Nov 02, 2011 @ 13:22
    Peder Andreasen
    0
    Anyone on this one? I have the same question:  "how do I set a member Name independent of the member Login in Umbraco 4.7?"
  • Benjamin Wyatt 3 posts 23 karma points
    Mar 05, 2012 @ 13:06
    Benjamin Wyatt
    0

    Saw this post recently: http://our.umbraco.org/forum/developers/api-questions/28358-Changing-the-displayed-member-name-in-C-code

    However, is there a better way of doing this without relying on an obsolete method?

Please Sign in or register to post replies

Write your reply to:

Draft