Copied to clipboard

Flag this post as spam?

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


  • Don Ross 28 posts 49 karma points
    Jul 25, 2011 @ 12:40
    Don Ross
    0

    Accessing Members from datatype

    Hi,

    I am new to Umbraco datatypes and am trying to access .NET Memberships from the datatype, but it seems to not be working. I can do the same thing on the front-end in a usercontrol, but this usercontrol using the user control wrapper in the backend fails on Membership.GetUser(id). Here is my code:

    protected void emailVerification_click ( object sender, EventArgs e )
            {
                sign_up su = new sign_up ();
                string id = Request["id"].ToString ();

                var member = Membership.GetUser ( id );
                MembershipUser mu = Membership.GetUser ( member.ProviderUserKey );
                su.sendVerificationEmail ( MemberProfile.GetUserProfile ( mu.UserName ) );
                msgTxt.Text = "A verification email has been sent";
            }

    Any insight or help would be greatly appreciated!

    Don

  • Michael Latouche 504 posts 819 karma points MVP 4x c-trib
    Jul 25, 2011 @ 12:46
    Michael Latouche
    0

    Hi Don,

    Can you maybe post the error message you get? This will help searching in the correct direction :-)

    Cheers,

    Michael.

  • Don Ross 28 posts 49 karma points
    Jul 25, 2011 @ 12:51
    Don Ross
    0

    Thanks for your reply, Michael. I just realized that I am trying to pass an ID into the GetUser method, which is expecting a string username. I will try something different!

  • Michael Latouche 504 posts 819 karma points MVP 4x c-trib
    Jul 25, 2011 @ 12:55
    Michael Latouche
    0

    OK,

    Good luck further !

    Cheers,

    Michael.

  • Don Ross 28 posts 49 karma points
    Aug 01, 2011 @ 13:04
    Don Ross
    0

    I was able to the member ID from the Request. If anyone knows a better way of doing this, I would be interested to hear!

Please Sign in or register to post replies

Write your reply to:

Draft