Copied to clipboard

Flag this post as spam?

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


  • Deci 19 posts 48 karma points
    Nov 14, 2011 @ 14:43
    Deci
    0

    GetUser() always null

    Shouldn't this work:

     _author = node.CreatorName;
     var user = System.Web.Security.Membership.GetUser(_author);

    I have a document that I want to find the member's loginname/username who created it.

    The document node will have the user id or his fullname but I want the loginname. I thought the above code would get it but it always returns null so I can't even begin to use the property .UserName.

    What have I done incorrectly? 

    Thanks

    Deci.


  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Nov 14, 2011 @ 14:53
    Jeroen Breuer
    0

    In Umbraco you have members and users. You are trying to get the user through the member api. That won't work. Try this:

    umbraco.BusinessLogic.User user = new umbraco.BusinessLogic.User(id);

    Jeroen

  • Deci 19 posts 48 karma points
    Nov 14, 2011 @ 14:59
    Deci
    0

    yep that did it. thanks Jeroen.

Please Sign in or register to post replies

Write your reply to:

Draft