More in this section

Forums / Developing with Sitefinity / How to implement User Profile Property as List?

How to implement User Profile Property as List?

4 posts, 2 answered
  1. alex.ozr
    alex.ozr avatar
    2 posts
    Registered:
    30 Sep 2009
    30 Sep 2009
    Link to this post
    Hello!
    Im new in Sitefinity development.. I want to know the best way to implement custom property in User Profile.
    I found some articles  about adding custom properties, but they don't work in my case.
    For example, in Sitefinity 3.7 we have user profile propery IM, where we should chose just One IM and enter nickname.. I want to let user to add some different IMs (ICQ, Jabber, Gtalk...).. it's obvious :) Everyone has not only one instant messegner... 
    What can you recommend as solution in this case?

    Thanks in Advance!
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    30 Sep 2009
    Link to this post
    Hello Alex Ermilov,

    You need to add group properties as shown below:

    <group name="InstantMessenger"
    <add name="IM_Type"/> 
    <add name="IM_Value"/> 
    <add name="Jabber_Type"/> 
    <add name="Jabber_Value"/> 
    </group> 

    More information about defining profile properties and profiles can be found at MSDN.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Answered
  3. alex.ozr
    alex.ozr avatar
    2 posts
    Registered:
    30 Sep 2009
    30 Sep 2009
    Link to this post
    Thanks for answer, Ivan!
    Your solution strongly defines that every user have one ICQ and one Jabber.
    I mean that user can add as many IM as he wants (just selecting type).
    123456 ICQ
    111111 ICQ
    123456 Jabber

    This behavior is like in Gmail Contacts.
    Can i implement such behavior using Sitefinity User Profile?
    something like store List<IM> in Profile, where instance of IM class contains Type and Value
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    30 Sep 2009
    Link to this post
    Hi Alex Ermilov,

    I am not sure whether you took at look at the link I sent you. You could have as many as you want Profile properties. So the easiest way will be creating a new profile property - one for ICQ, one for Jabber etc. Then you can get each property value using SettingsPropertyCollection

     
            SettingsPropertyCollection b = ProfileBase.Properties; 
            foreach (SettingsProperty prop in b) 
            { 
                Response.Write(prop.Name.ToString()); 
            } 

    I hope this helps.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Answered
Register for webinar
4 posts, 2 answered