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

Forums / Developing with Sitefinity / Creating Users With Custom Control

Creating Users With Custom Control

2 posts, 0 answered
  1. Armysniper
    Armysniper avatar
    126 posts
    Registered:
    03 Mar 2005
    26 Jan 2009
    Link to this post
    Because my needs for registration are pretty big, I want to create a custom control that will not only create the user in Site Finity but also create custom profile data after the user has been registered with SiteFinity. I am very familiar with the ASP.NET Membership Model. Should I create my user with the standard Membership classes of ASP.NET or use the Telerik.Security.UserManager class? It mentions very little in the documentation other than it is for managing CMS users.

    What is the difference between a CMS user and a regular user? I thought I read there was only role and permission differences. Which route should I go to get my users created properly in the system and also give them the proper roles from Site Finity?
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    29 Jan 2009
    Link to this post
    Hi Shannon,

    Here is an example:

    // create user using CreateUser method  
    MembershipUser user = Membership.CreateUser("USER_NAME""PASSWORD""EMAIL@ADDHERE.COM"); 
    ProfileBase profile = ProfileBase.Create(user.UserName); 
    profile.SetPropertyValue("FirstName", user.UserName); 
    // assign user to role 
    Roles.CreateRole(user.UserName); 
    Roles.AddUserToRole(user.UserName, user.UserName); 
    // save user 
    profile.Save(); 

    I hope this will help you to answer your questions.

    Regards,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
2 posts, 0 answered