1 Reply Latest reply on Nov 28, 2012 2:23 PM by 940630

    How to use createuser


      I do not know how to use this method:
      CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out System.Web.Security.MembershipCreateStatus status)

      In my web.config, I have these defined:

      My questions are:
      1. do I still need to supply email and question/answser?
      2. what is providerUserKey? how can I get it and then give it to createuser method as an input?

      Thanks in advance.
        • 1. Re: How to use createuser
          I did not find out what was wrong in my code. I switched to use system.web.security.membershipprovider. Now I can create a user.
          Here is the lines which works:

          MembershipProvider provider = Membership.Provider;
          MembershipUser newUser = null;
          MembershipCreateStatus status = new MembershipCreateStatus();
          newUser = provider.CreateUser(user, password, email, null, null, true, null, out status);

          Edited by: YLiAustin on Nov 28, 2012 6:22 AM