Copied to clipboard

Flag this post as spam?

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


  • Sean 141 posts 179 karma points
    Mar 29, 2011 @ 21:56
    Sean
    0

    No member with username 'xxxxxxx' exists

    Hi There,

    I was wondering if somone could help me with this error that I'm getting. It's No member with username 'xxxxxxx' exists.

    I'm wanting to create a new member and save them, so I would expect that the provider would return this message given that I want all usernames to be unique.

    How can I get this status as a message and then process the new member accordingly or am I just doing it completely wrong.

    Thanks in advance.

    Sean

     

         
    //member class
            public static MemberProfile GetUserProfile()
            {
                return Create(Membership.GetUser().UserName) as MemberProfile;
            }

           
    //snippet from the OnCreatingUser event
    myproject.Members.MemberProfile mp = myproject.Members.MemberProfile.GetUserProfile(strUserName);
                            if (mp != null)
                            {
                                mp.AuthGuid = newUserGuid;
                                mp.secretQuestion = ((DropDownList)cuw.CreateUserStep.ContentTemplateContainer.FindControl("Question")).Text;
                                mp.secretAnswer = ((TextBox)cuw.CreateUserStep.ContentTemplateContainer.FindControl("Answer")).Text;
                                mp.isLocked = true;
                                mp.isApproved = false;
                                mp.Save();

                                Roles.AddUserToRole(strUserName, "Retail");

  • Richard Soeteman 4045 posts 12898 karma points MVP 2x
    Mar 30, 2011 @ 06:04
    Richard Soeteman
    0

    Hi,

    You need  to change the following line and use the string value. Now you are submitting an empty value

    Create(Membership.GetUser().UserName)

    Cheers,

    Richard

  • Sean 141 posts 179 karma points
    Mar 31, 2011 @ 11:39
    Sean
    0

    Hi Richard,

    I'm not sure what I'm doing wrong here. I'm passing the username value and it's still giving me the same error. Any other things I need to look at?

    I changed this:

     

      public static MemberProfile GetUserProfile()
            {
                return Create(Membership.GetUser().UserName) as MemberProfile;
            }

    to this:

       public static MemberProfile GetUserProfile(string username)
            {
                return Create(username) as MemberProfile;
            }

     

  • Sean 141 posts 179 karma points
    Apr 01, 2011 @ 22:27
    Sean
    0

    Hello?

Please Sign in or register to post replies

Write your reply to:

Draft