Great, glad that worked. I think in the case of no member being found with the id supplied 'yourMember' would be null. So you can do a check on that before you run any subsequent code.
Regarding documentation, yep, same here, but things have improved in 6.2/7.1 where there's a brand new member API which has some new documentation. Possibly worth upgrading to 6.2 if you're going to be doing a lot of membership API stuff, although I've not tried it myself yet (the other new APIs e.g. the new Content Service, are much better though). The old membership documentation is here in case you'd not come across it http://our.umbraco.org/documentation/Reference/Management/MembershipProviders/, but it is definitely lacking detail. Feel free to keep posting on 'Our' though if you have any other specific questions and can't find the documentation - it's likely that someone can ease the frustration. :)
Getting member by its ID
How do I do this, since there aren't a GetMemberById Method available. The member aren't logged in.
I get their Id from a cardscanner
Umbraco Version 6.1.6
Hi Jan,
Something like this should work:
That works, but what happens if I supply a memberId that doesn't exist? I find it hard to get proper documentation for these methods
Great, glad that worked. I think in the case of no member being found with the id supplied 'yourMember' would be null. So you can do a check on that before you run any subsequent code.
Regarding documentation, yep, same here, but things have improved in 6.2/7.1 where there's a brand new member API which has some new documentation. Possibly worth upgrading to 6.2 if you're going to be doing a lot of membership API stuff, although I've not tried it myself yet (the other new APIs e.g. the new Content Service, are much better though). The old membership documentation is here in case you'd not come across it http://our.umbraco.org/documentation/Reference/Management/MembershipProviders/, but it is definitely lacking detail. Feel free to keep posting on 'Our' though if you have any other specific questions and can't find the documentation - it's likely that someone can ease the frustration. :)
is working on a reply...