More in this section

Forums / Developing with Sitefinity / How to add drop down list to custom Registration template

How to add drop down list to custom Registration template

4 posts, 0 answered
  1. J
    J avatar
    1 posts
    Registered:
    19 Jun 2012
    19 Jun 2012
    Link to this post
    Hello all - I am fairly new to Sitefinity, and need some pointers on how to do something which seems like it should be straightforward, but I just can't find what I need.

    My site will allow users to register, so I am using the Registration widget. I have a custom Profile Type because I want to add several custom fields to the Registration form.  I would like to add a State drop down list to the form, which is defined as a custom template within Sitefinity.

    So, my question is this:  Is it best to create a separate States table, and refer to that in a custom field of my profile type? If so, how would I do that?  My other option seems like I would just add a Choice type field, and manually add all of the states as choices within Sitefinity. 

    And the follow up question - how do I add that field to my custom template for the Registration widget?

    Thanks in advance for your time and assistance.
  2. Grace Hallwachs
    Grace Hallwachs avatar
    144 posts
    Registered:
    03 Nov 2014
    22 Jun 2012
    Link to this post
    Hello,

    Unfortunately this is not a trival task but we have a workaround for this type of situation.

    You can create a dropdownfield that creates a statedropdown field and it to your widget template. In order to register the field for the users go to Administration->Users->Manage profile types(in the right sidebar)->Basic Profile and create new custom field for the basic profile. Leave the type "short text" in "Interface widget for entering data" select custom and in the textbox add the namespace to the custom widget ( Widgets.Selectors.TaxSelector.TaxonomyDropDownField ), save changes. The dropdown is added to the users module.

    I have included a code sample for your reference.

    <%@ Register TagPrefix="sf" Namespace="Widgets.Selectors.StateSelector" Assembly="Widgets.Selectors" %>
         
      
    <sf:StateDropDownField
      
                    runat="server"
      
                    id="StateTaxonomySelector"
      
                    DataFieldName="StateTaxonomySelector 
    "
      
                    DataItemType="Telerik.Sitefinity.Security.Model.SitefinityProfile"
      
                    DisplayMode="Write"
      
                    RenderChoicesAs="DropDown"
      
              Title = "State"
      
              />

    Please let me know if you have any additional questions. Greetings,
    Grace Hallwachs
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Rick
    Rick avatar
    32 posts
    Registered:
    13 Dec 2006
    21 Nov 2012
    Link to this post
    I have followed the steps above but I get errors when I try to save


    I have created the custom control and put it in the widget templates portion of my site.

    I then add the path to that and it says it can't find SitefinityWebApp.stateDropDown  (the last part is the name of our user control)

    Any ideas?
  4. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    26 Nov 2012
    Link to this post
    Hello Rick,

    It seems that the system is having troubles finding the correct path to the namespace you are using.

    For your convenience I am attaching a sample, which is actually a registration form control, inheriting from the original one. In that form I have put a RadComboBox which will be getting list of countries ( which are actually tags )and displaying them for the user to choose from when registering.

    Country2 ( found in the code ) is the custom profile field that holds the taxon called Countries ( FlatTaxon ). The FlatTaxon called Countries contains all the countries I want to choose from.

    You can register the control in the toolbox section of the application.

    All the best,
    Victor Velev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
4 posts, 0 answered