+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / CreateUser returns null

CreateUser returns null

4 posts, 0 answered
  1. Big
    Big avatar
    8 posts
    Registered:
    14 Dec 2010
    10 Jan 2011
    Link to this post
    I'm using the default UserManager and calling CreateUser(userName, password, email) but it is returning null and not throwing an exception. 
    Am I using it incorrectly?
    UserManager.Default.CreateUser(userName, password, email);
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    10 Jan 2011
    Link to this post
    Hello Big,

    UserManager.Default.CreateUser(userName, password, email); means that you will use the Default Membership provider explicitly. There should not be a problem if you use this code

    var manager = new UserManager();
    manager.CreateUser("name1", "mypasword", "test@dadasdasd.tc");

    You can get null from CreateUser if something fails internally in the method. For instance you have set requiresQuestionAndAnswer="true"

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Big
    Big avatar
    8 posts
    Registered:
    14 Dec 2010
    11 Jan 2011
    Link to this post
    These are my settings
                    <add name="Sitefinity" connectionStringName="DefaultConnection" type="Telerik.DataAccess.AspnetProviders.TelerikMembershipProvider, Telerik.DataAccess" applicationName="/" passwordFormat="Hashed" />

    and it returns null.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    11 Jan 2011
    Link to this post
    Hi Big,

    I am not able to replicate this issue. UserManager uses - MembershipProvider.CreateUser Method so you can try to call it directly.

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
4 posts, 0 answered