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

Forums / Developing with Sitefinity / Custom User Properties

Custom User Properties

4 posts, 0 answered
  1. Stephen
    Stephen avatar
    5 posts
    Registered:
    23 Jun 2010
    26 Oct 2010
    Link to this post
    Hi all,

    I have added a few custom properties to Sitefinity users.  
    I have Modified Sitefinity/Admin/CmsAdmin/Users.aspx and I have added the properties to the web.config file.

    One of the properties I have entered is an asp checkbox.  Here is the code
    <asp:CheckBox ID="RegistrationConfirmed" runat="server" />

    This has been placed in <cc1:ManageProfile runat="server" ID="manageProfile" Mode="Edit"> in the Users.aspx file. 

    My problem is this
    Before I added this checkbox to the Users.aspx file, there were already Users created.  When I select one of these users, I get the following error:

    String was not recognized as a valid Boolean. 


    This can be solved if I add the "RegistrationConfirmed" property to the dbo.telerik_UserMetaInfo table with a value of 0 or 1 in the Text column.  I assume this prevents a NULL from been returned.  

    I don't want to have to enter property values to the telerik_UserMetaInfo table for every user that does not have this already assigned. 

    How do I provide a default value?  ( I have already tried to add a defaultValue property to the property listed in the web.config file, it does not solve the problem)

    Thanks!
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    26 Oct 2010
    Link to this post
    Hello Stephen,

    You can set a default value for the property through the web.config declaration - Defining ASP.NET Profile Properties

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Stephen
    Stephen avatar
    5 posts
    Registered:
    23 Jun 2010
    26 Oct 2010
    Link to this post
    I already posted in my question that I have attempted that and it does not work.

    (I have attempted this numerous times for the checkbox as well as another data bound dropdownlist control.  The defaultValue property in the properties does not solve the problem)
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    26 Oct 2010
    Link to this post
    Hi Stephen,

    For the old users there is no such a entry in the database. You can check the value inside Users.aspx.cs and set some value, but this will be much harder that changing the database records.
    You could override OnPreRender

    Telerik.Security.WebControls.ManageUsers.EditContainer

    and there access the ProfileManager control.

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
4 posts, 0 answered