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

Forums / General Discussions / Adding field to user registration control

Adding field to user registration control

4 posts, 0 answered
  1. Mark Bourland
    Mark Bourland avatar
    5 posts
    Registered:
    19 Jan 2007
    17 Apr 2009
    Link to this post
    On the website I'm developing using Sitefinity, I would like to customize the fields on the registration form for new users.  I basically want a field that would be a "registration code" field so that if the user doesn't have the proper code, they can't register.

    Is this possible or will I need to look into developing my own custom registration control?
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    21 Apr 2009
    Link to this post
    Hi Mark Bourland,

    You should add these fields to the following node:
    <profile defaultProvider="Sitefinity"
          <providers> 
            <clear /> 
            <add name="Sitefinity" connectionStringName="DefaultConnection" applicationName="/" type="Telerik.DataAccess.AspnetProviders.TelerikProfileProvider, Telerik.DataAccess" /> 
          </providers> 
          <properties> 
            <add name="FirstName" /> 
            <add name="LastName" /> 
            <add name="NewField" /> 
          </properties> 

    Then, you should add the fields in the necessary pages, located in [YourProject]\Sitefinity\Admin\CmsAdmin.

    The concept is the same as the metafields.
    Don't hesitate to contact us if you have other questions.

    Best wishes,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Mark Bourland
    Mark Bourland avatar
    5 posts
    Registered:
    19 Jan 2007
    21 Apr 2009
    Link to this post
    That's great for adding a field to the profile, but ..

    How can I validate that the user entered the correct value for the field before they are successfully registered as a new user?
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    21 Apr 2009
    Link to this post
    Hello Mark Bourland,

    To validate a filed you can use Validation Server controls( http://www.w3schools.com/aspnet/aspnet_refvalidationcontrols.asp)
    If you want to validate the text/value that has been enetered by your own criteria you could get the value and compare it with desired result.

    Sample:

    string Name = ((TextBox)Login1.FindControl("Name")).Text;  
     
                if(Name.Equals(requiredname))  
                {  
                    // do something with your user.  
                } 


    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
4 posts, 0 answered