Copied to clipboard

Flag this post as spam?

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


  • Frederik T 216 posts 306 karma points
    Sep 15, 2016 @ 08:03
    Frederik T
    0

    Problems getting member data with custom membership provider

    In short, I have created a custom membership provider and a custom member. This is using the "old" .NET membership provider system. Right now I can log in successfully, and the custom member is accepted by the system as well.

    Note: Only methods implemented so far in the membership provider is "ValidateUser(name, pass)" and "GetUSer(username, isonline)"

    The problem is, I cant get any info from the custom member. Nothing. Everything I have tried fails. I dont think it will even matter to list what I have tried, and Googling doesnt return anything that works. Its funny how I feel like the only person in the world who has a custom member, but obviously I cant be :/

    I am using Umbraco 7.5.2 if it helps.

  • Frederik T 216 posts 306 karma points
    Sep 15, 2016 @ 12:31
    Frederik T
    0

    Well this is my solution so far, in the custom membership provider, when getting the user during the log in process, I send the entire member object to the session.

    In my view i do like this:

    @if (Members.IsLoggedIn())
        {
            Site.Extensions.TripleAMembershipUser tmpUser = new Site.Extensions.TripleAMembershipUser();
            if (Session["currentUser"] != null)
            {
                tmpUser = (Site.Extensions.TripleAMembershipUser)Session["currentUser"];
                <div><h1>@tmpUser.someCustomString</h1></div>
            }
        }
    

    It gets the job done. But far from perfect.

Please Sign in or register to post replies

Write your reply to:

Draft