Hey Guys
I'm currently working on a solution combining a web application with YAF Forums 1.9.3.
Im planning to use the security and login functionality of the YAF forums for both YAF and the original site however i have come across problems trying to get hold of the user from the original site once logged into YAF.
I find that i can use Role providers from my main site without an issue ie
return Roles.IsUserInRole("Administrators");
however when i try to use
MembershipUser user = Membership.GetUser();
It will always throw an object reference exception. I imagine it is because it cannot find a current user. It seems strange to me then that this very command is used in YAF without any problem. Perhaps the main site gets the same instance of the Role Provider but when it access the Membership Provider it gets a different instance ??
Can someone let me know, is this typically how you should go about getting the current user? If i at least know that then i have something to go on however if that is incorrect it would be good to know before going down that road any further.
Any help is greatly appreciated
Cheers