Copied to clipboard

Flag this post as spam?

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


  • ds 191 posts 223 karma points
    Aug 10, 2011 @ 15:11
    ds
    0

    MembershipProvider.GetAllUsers Method instead of Member.GetAll

    I have been trying to display custom member property data in one of my webpage. If I ever try Member.GetAll, it says that it is obsolote. In place of it MembershipProvider.GetAllUsers is recommended.

    How can I reach custom member property data using MembershipProvider.GetAllUsers? Any example would be great.

  • ds 191 posts 223 karma points
    Aug 11, 2011 @ 08:44
    ds
    0

    Any idea guys?

  • ds 191 posts 223 karma points
    Aug 12, 2011 @ 08:32
    ds
    0

    I really need help on this issue, guys...

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Aug 12, 2011 @ 13:26
    Sebastiaan Janssen
    0

    You don't actually HAVE to use anything else. Obsolete doesn't mean it doesn't work any more.. But, how about so:

          var members = Membership.GetAllUsers();
          foreach (Member member in members)
          {
            var propertyValue = member.getProperty("yourCustomProperty").Value;
          }
  • ds 191 posts 223 karma points
    Aug 12, 2011 @ 13:31
    ds
    0

    I just get the following error

     

    Unable to cast object of type 'System.Web.Security.MembershipUser' to type 'umbraco.cms.businesslogic.member.Member'

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Aug 12, 2011 @ 13:48
    Sebastiaan Janssen
    0

    Hmmm, well I haven't tried this code, in that case you should probably just use the obsolete method for now unless someone else has a better idea.

  • ds 191 posts 223 karma points
    Aug 12, 2011 @ 14:11
    ds
    0

    OK then, unless someone else has better idea, I should take the obsolete method. Thanks

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Aug 12, 2011 @ 14:48
    Dirk De Grave
    0

    Yup, go for the obsolete methods, altho I think there should be a way of doing it, but may require some work.. Found some references on SO regarding this, and it may be a solution, altho haven't tried it... Here's the link

    If there is another (or better) way of doing it, would love to hear about it.

    Cheers,

    /Dirk

Please Sign in or register to post replies

Write your reply to:

Draft