More in this section

Forums / Developing with Sitefinity / Checkboxes is not recognize on manageprofile

Checkboxes is not recognize on manageprofile

9 posts, 0 answered
  1. Roland
    Roland avatar
    45 posts
    Registered:
    23 Feb 2009
    06 Apr 2009
    Link to this post
    I added a new property under the profile in the web.config and named it "IsVendor" which is of boolean type then I added a checkbox control and gave it an Id of "IsVendor"  on the manageprofile of the CreateUserWizardControl.ascx. When I click the signup button it is successful however when I check the database and queried the Telerik_UsersMetaInfo I found out that the value of the IsVendor is NULL. How will I make the manageprofile work correctly?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    06 Apr 2009
    Link to this post
    Hi Roland,

    I am not able to reproduce this behavior. Please make sure you are adding "isVendor" TextBox control under the following section of CreateUserWizardcontrol

     <sec:ManageProfile ID="ManageProfile" runat="server" Mode="Insert" GenerateButtonsInDefaultTemplate="false" > 
        <InsertTemplate> 
            <fieldset> 
                <ul> 
                    <li> 
                        <asp:Label AssociatedControlID="FirstName" ID="FirstNameLabel" runat="server" Text="First name <em>(optional)</em> :" /> 
                        <asp:TextBox ID="FirstName" runat="server" /> 
                    </li> 
                    <li> 
                        <asp:Label AssociatedControlID="LastName" ID="LastNameLabel" runat="server" Text="Last name <em>(optional)</em> :" /> 
                        <asp:TextBox ID="LastName" runat="server" /> 
                    </li> 
                        <li> 
                            <asp:Label ID="isVendorLabel" runat="server" AssociatedControlID="isVendor">isVendor:</asp:Label> 
                                <asp:CheckBox runat="server" ID="isVendor"/> 
                            </li> 
                </ul> 
            </fieldset> 
        </InsertTemplate> 
    </sec:ManageProfile> 

    In the code behind the manager sets this properties to the user you are crating.

    ManageProfile.SetProfileProperties 

    You should have BoolValue 1 in telerik_UserMetaInfo table for PropertyName  IsVendor  
    Make sure that you have System.Boolean type for your profile property in the web.config file.   
    <add name="IsVendor" type="System.Boolean"/> 

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  3. Roland
    Roland avatar
    45 posts
    Registered:
    23 Feb 2009
    06 Apr 2009
    Link to this post
    Hi Ivan,

    I already implemented your solution however I still get the same problem. Here is my actual code.
    This is on the manage profile and you can see the RegisteredVendor as a checkbox:  
     
    <sec:ManageProfile ID="ManageProfile" runat="server" Mode="Insert" GenerateButtonsInDefaultTemplate="false">  
        <InsertTemplate>  
            <fieldset>  
                <ul>  
                    <li>  
                        <asp:Label AssociatedControlID="FirstName" ID="FirstNameLabel" runat="server" Text="Firstname:" />  
                        <asp:TextBox ID="FirstName" runat="server" />  
                        <asp:RequiredFieldValidator ID="rqdFirstname" ControlToValidate="FirstName" ErrorMessage="Firstname is required." runat="server"></asp:RequiredFieldValidator>  
                    </li>  
                    <li>  
                        <asp:Label AssociatedControlID="LastName" ID="LastNameLabel" runat="server" Text="Lastname:" />  
                        <asp:TextBox ID="LastName" runat="server" />  
                        <asp:RequiredFieldValidator ID="rqdLastname" ControlToValidate="LastName" ErrorMessage="Lastname is required." runat="server"></asp:RequiredFieldValidator>  
                    </li>  
                    <li>  
                        <asp:Label AssociatedControlID="DisplayName" ID="DisplayNameLabel" runat="server" Text="Displayname:" />  
                        <asp:TextBox ID="DisplayName" runat="server" />  
                        <asp:RequiredFieldValidator ID="rqdDisplayname" ControlToValidate="DisplayName" ErrorMessage="Displayname is required." runat="server"></asp:RequiredFieldValidator>  
                    </li>  
                    <li>  
                        <asp:Label AssociatedControlID="CompanyName" ID="CompanyNameLabel" runat="server" Text="Company Name:" />  
                        <asp:TextBox ID="CompanyName" runat="server" />  
                    </li>  
                    <li>  
                        <asp:Label AssociatedControlID="CompanyWebsite" ID="CompanyWebsiteLabel" runat="server" Text="Company Website:" />  
                        <asp:TextBox ID="CompanyWebsite" runat="server" />  
                    </li>  
                    <li>  
                        <asp:Label ID="RegisteredVendorLabel" runat="server" AssociatedControlID="RegisteredVendor">Are you a registered vendor:</asp:Label>  
                        <asp:CheckBox ID="RegisteredVendor" runat="server"  Text="I am a registered vendor of Windows Embedded Partner Program"/>  
                    </li>  
                </ul>  
            </fieldset>  
        </InsertTemplate>  
    </sec:ManageProfile>  
     
     
    And this is what I have in the web.config:  
     
    <properties>  
             <add name="FirstName" />  
             <add name="LastName" />  
             <add name="DisplayName" />  
             <add name="CompanyName" />  
             <add name="CompanyWebsite" />  
             <add name="RegisteredVendor" type="System.Boolean"/>  
          </properties>  
     
    All fields are inserting well but not for the RegisteredVendor. It always stores null on the table telerik_usermetainfo 
  4. Roland
    Roland avatar
    45 posts
    Registered:
    23 Feb 2009
    06 Apr 2009
    Link to this post
    By the way I'm using 3.5 Community Version..
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    07 Apr 2009
    Link to this post
    Hello Roland,

    I added a new profile property( actually the one from your code) under community project version 3.5 and the bool value was set in the database( true/false or 1/0). Please refresh  telerik_UserMetaInfo table after adding a new user. You should be able to see property value.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  6. Roland
    Roland avatar
    45 posts
    Registered:
    23 Feb 2009
    07 Apr 2009
    Link to this post
    Its really stores NULL value for the RegisteredVendor. I think the problem is in the Manageprofile.Setprofileproperties methods which I think it only supports controls that implements ITextControl which checkbox does not.
  7. Roland
    Roland avatar
    45 posts
    Registered:
    23 Feb 2009
    07 Apr 2009
    Link to this post
    Atlast I was able to make it. Its really the ManageProfile.SetProfileProperties. What I did is that I created a new class derived from checkbox and then implemented Itextcontrol with it and it works now. Thanks Ivan for the assistance.
  8. OC
    OC avatar
    129 posts
    Registered:
    17 Nov 2004
    17 Sep 2009
    Link to this post
    Hello, I'm trying to do the exact same thing. Could you please share your code for this?

    Thanks,
    OC
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    17 Sep 2009
    Link to this post
    Hi Mutantmannen,

    Checkbox support is implemented for Sitefinity 3.7 SP1. You can download the last official release from your account >> Downloads section.

    Greetings,
    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.
Register for webinar
9 posts, 0 answered