Copied to clipboard

Flag this post as spam?

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


  • Dimitris Lampsakis 4 posts 74 karma points
    Oct 12, 2015 @ 07:34
    Dimitris Lampsakis
    0

    Get node uniqueid by nodeid in a controller

    Hi I need to get the uniqueid (Guid) of node for the current user. i managed to get the user info with

       MembershipUser current = Membership.GetUser();
    

    but i cant get to the node uniqueid.

    tried this one

            int usernodeid = Convert.ToInt32(current.ProviderUserKey);
            var node = new Node(usernodeid);
    

    but didn't got the node . i know that my variable usernodeid has the right id, but i can't reach to the final point. Thanks a lot.

  • Dimitris Lampsakis 4 posts 74 karma points
    Oct 12, 2015 @ 08:01
    Dimitris Lampsakis
    0

    As many times happens .. i found a solution after posting the question. this little piece of code did the magic

     MembershipUser current = Membership.GetUser();
     int usernodeid = Convert.ToInt32(current.ProviderUserKey);
     Guid userGuid = uQuery.GetMember(usernodeid).UniqueId;
    

    Let me know if there is a better way.

Please Sign in or register to post replies

Write your reply to:

Draft