Copied to clipboard

Flag this post as spam?

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


  • Steve Brown 125 posts 290 karma points
    Jul 17, 2013 @ 22:46
    Steve Brown
    0

    get a member by a custom property

    How do I retrieve a member by a custom property? I'm trying something like this and getting YSOD, Object reference not set to an instance of an object.               

    Member myMember = Member.GetAllAsList().SingleOrDefault(x => x.getProperty("myProperty").Value.ToString() == strMyProperty);

  • Charles Afford 1163 posts 1709 karma points
    Jul 17, 2013 @ 23:03
    Charles Afford
    0

    Hi,  What version of umbraco?  Take a look at my blog post for this :).  http://www.charlesafford.com/umbraco-membership-provider.aspx

    Hope that helps.

  • Charles Afford 1163 posts 1709 karma points
    Jul 17, 2013 @ 23:07
    Charles Afford
    0

    can you debug your code?  are you getting anything in Member.GetAllAsList?

    if so then i guess it will be the property name.  remember to check of the property exsists and that it is not null or empty :).  Charlie.

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Jul 18, 2013 @ 12:12
    Jeroen Breuer
    0

    You could try uMembership. It has a method called SearchMembersByPropertyValue.

    Jeroen

  • Dupeng 5 posts 25 karma points
    Sep 09, 2013 @ 07:42
    Dupeng
    0

    Thanks!

Please Sign in or register to post replies

Write your reply to:

Draft