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.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. 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