Create users

When creating a user, you must perform the following steps:
  1. Get instances of the user and user profile managers.
    The managers are represented by the UserManager and UserProfileManager classes. For more information about getting their instances, see Managing users.
  2. Create the user.
    To create the user call the CreateUser method of the UserManager class and pass the required arguments. The CreateUser method accepts an output parameter of type System.Web.Security.MembershipCreateStatus, that provides information about the result of the operation. The method returns the instance of the created user. For more information, about the User class, see Users.
  3. Check whether the user has been created successfully.
    If the user has been created successfully, the value of the output parameter must be equal to MembershipCreateStatus.Success.
  4. Create a user profile for the user.
    If the user has been create successful, you create a user profile for him. To do this, call the CreateProfile method of the UserProfileManager class and pass the required parameters. For the type of profile you use SitefinityProfile. For more information, see For developers: User profiles.
  5. Save the changes.
    Finally, you save the changes to both UserManager and UserProfileManager.
Here is a code example:

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Web Security for Sitefinity Administrators

The free standalone Web Security lesson teaches administrators how to protect your websites and Sitefinity instance from external threats. Learn to configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?

Next article

Query users