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

Forums / General Discussions / how to use function "custom profile types" to add country and state in profile/sign up page

how to use function "custom profile types" to add country and state in profile/sign up page

9 posts, 0 answered
  1. li
    li avatar
    30 posts
    Registered:
    02 Jan 2009
    28 Apr 2011
    Link to this post
    Hi,
    I'm trying to use the new function -- custom profile types from 4.1, but having a problem here:
    I want to create two fields: state, country. in front end, when you change country, a new state list needs to be loaded.
    state and country are dropdownlist, the value read from two tables just like what we did before.
    I saw there is "custom" way to add a usercontrol for the field, but I don't know if it's the correct way to do that.
    Can anyone help me with this?
    Thanks,
  2. Lubomir Velkov
    Lubomir Velkov avatar
    688 posts
    Registered:
    03 Nov 2014
    03 May 2011
    Link to this post
    Hello li,

    Could you point me where did you find this custom way to add a usercontrol for the field?

    All the best,
    Lubomir Velkov
    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. li
    li avatar
    30 posts
    Registered:
    02 Jan 2009
    03 May 2011
    Link to this post
    Hi Thank you for your reply.
    Please see the attached jpg files. the url is ~/sitefinity/administration/profiletypes(1.jpg),
    what I'm trying to do is creating two fields: state, country on basic profile. In front end, when you change country, a new state list needs to be loaded.
    state and country are dropdownlist, the value read from two tables just like what we did before.
    I know how to add a textbox field using this profile type page, for example, middle name(2.jpg). I also know how to create a multiple choice field(4.jpg), but
    1. can I create a new table(state table), and link the field value to that new table?
     2. How can I use customcontrols type(3.jpg), any sample for the ascx file?

    Thank you,
  4. Lubomir Velkov
    Lubomir Velkov avatar
    688 posts
    Registered:
    03 Nov 2014
    05 May 2011
    Link to this post
    Hi li,

    I think you can add a new table (state table) and link it but - it requires a lot of additional custom JavaScript and Ajax coding. As for the .ascx file - I don't think you can add such field type.

    All the best,
    Lubomir Velkov
    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
  5. li
    li avatar
    30 posts
    Registered:
    02 Jan 2009
    05 May 2011
    Link to this post
    Hi Lubomir,
    Thank you for your reply.
    1. Can you explain more about "link it" to the new table -- we don't mind to add additional custom javascript and ajax coding.
    2. sorry, if "profile types" doesn't support .ascx file, why there is an option sitting there? Can you please double check this?

  6. Lubomir Velkov
    Lubomir Velkov avatar
    688 posts
    Registered:
    03 Nov 2014
    06 May 2011
    Link to this post
    Hello li,

    Apparently for #2 of your questions - this feature was never tested extensively and it seems not to be working properly. I have logged a bug in our bug tracking system for this.

    As for #1 of your questions - it involves writing custom JavaScript code - e.g. using jQuery - that attached an event handler to the onchange event of the first dropdown and then using some custom code - e.g. an Ajax call - to retrieve the values that are dependent on the selected value from the first dropdown.

    Kind regards,
    Lubomir Velkov
    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
  7. li
    li avatar
    30 posts
    Registered:
    02 Jan 2009
    06 May 2011
    Link to this post
    Hi Lubomir,
    Thank you.
    First let me explain what we exactly need. Please see the attachment jpg:
    We need to custom user profile and add some fields like salutation, address, city, state, country, etc. just like all the other sites, we need sign up page, my account page(updating user's info), user admin page(~/Sitefinity/Administration/Users)

    Option 1:
    I know that I can easily add some of fields, for example salutation(which would be a multiple choices, I can do that by using one of profile types like this: http://www.sitefinity.com/ClientsFiles/268002_4.jpg), zip code would be easy, which is just a textbox.

    problem: But it seems that state and country are not easy if we use the new feature "profile types" on sitefinity 4.1

    Option 2:
    We create our own custom profile database table and create a new usercontrol for sign up page, my account page, that's easy too.

    problem: But don't know which is the best way to add those custom fields(salutation, address, city, state, country) onto backend page ~/Sitefinity/Administration/Users, and format/style the user detail view(the view when you click one user on user list) on this page. or in other word, how can I "edit" this backend page. -- on sitefinity 3.7, I can access the source code if I want to customize this page.

    Could you give me the best solution for this? I believe that every sitefinity 4.1 site will have to face this problem.
    Your answer will save our life.
    Thank you again.
  8. Lubomir Velkov
    Lubomir Velkov avatar
    688 posts
    Registered:
    03 Nov 2014
    12 May 2011
    Link to this post
    Hello li,

    Please check the following demo that shows how to achieve desired result.

    http://demos.telerik.com/aspnet-ajax/ajax/examples/common/settingfocus/defaultcs.aspx

    You could refer to our api to get some more details about working with Sitefinity's objects

    Best wishes,
    Lubomir Velkov
    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
  9. Anthony
    Anthony avatar
    17 posts
    Registered:
    21 May 2003
    12 May 2011
    Link to this post
    Hi Lubomir,

    I think what li is trying to accomplish is something similar to me, actually replace the backend view templates, in 3.7 you provided these templates as an additional download resource, in 4.1 we can see the reference to the view used for editing in the config section to replace this with our own custom view it would be really useful to obtain the original Sitefinity view as we could do in 3.7

    Hope this make sense

    Anthony
9 posts, 0 answered