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

Forums / Developing with Sitefinity / Adding Profile Items

Adding Profile Items

6 posts, 0 answered
  1. Steven
    Steven avatar
    12 posts
    Registered:
    30 Dec 2009
    12 Jun 2010
    Link to this post
    I've been trying to add profile fields to the CreateUserWizardControl.ascx.  The fields work fine from the pages with the CMS Admin, but the live site fiends go without saving.

    Can you add profile fields to the CreateUserWizardStep - I've added fields like you do to the Users page inside Admin, but it hasn't worked.

    Thanks
    Steve

  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    14 Jun 2010
    Link to this post
    Hi Steven,

    Have you added the fields to the web.config file, section <profile><properties> as well? These properties act like meta fields, and are persistable automatically.

    Sincerely yours,
    Georgi
    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. Steven
    Steven avatar
    12 posts
    Registered:
    30 Dec 2009
    14 Jun 2010
    Link to this post
    Yes, the fields are added into the proper web config area.  They save and work as expected from the CMS Profile screens.  However on the live site when a user tries to create their account.  It doesn't save.  I've tried adding a field to the "CreateUserTemplate" and when that didn't work, I tried to add a step to the Create User Wizard

    Thanks
    Steve
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    14 Jun 2010
    Link to this post
    Hello Steven,

    Could you send the ascx file of the CreateUserWizard control? All profile properties should be defined inside
    ManageProfile control if you want to persist them automatically. All profile properties should be declared in the web.config as well. 

    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.
  5. Steven
    Steven avatar
    12 posts
    Registered:
    30 Dec 2009
    17 Jun 2010
    Link to this post
    it's not letting me attach to the post, ascx is wrong type, so i'll copy and past it here:

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="CreateUserWizardControl.ascx.cs" Inherits="CreateUserWizardControl" %>
    <%@ Register Assembly="Telerik.Security" Namespace="Telerik.Security.WebControls" TagPrefix="sec" %>
    <h3>Signup</h3>
     <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>
                </ul>
            </fieldset>
        </InsertTemplate>
    </sec:ManageProfile>
    <asp:CreateUserWizard ID="CreateUserWizard1" runat="server" CreateUserButtonText="Sign up">
        <WizardSteps>
            <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">
                <ContentTemplate>
                    <fieldset>
                        <ul>
                            <li>
                                <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User name:</asp:Label>
                                <asp:TextBox ID="UserName" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
                                    ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                            </li>
                            <li>
                                <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
                                <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                                    ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                            </li>
                            <li>
                                <asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword">Confirm password:</asp:Label>
                                <asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" ControlToValidate="ConfirmPassword"
                                    ErrorMessage="Confirm Password is required." ToolTip="Confirm Password is required."
                                    ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                            </li>
                            <li>
                                <asp:Label ID="QuestionLabel" runat="server" AssociatedControlID="Question">Security question:</asp:Label>
                                <asp:TextBox ID="Question" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="QuestionRequired" runat="server" ControlToValidate="Question"
                                    ErrorMessage="Security question is required." ToolTip="Security question is required."
                                    ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                            </li>
                            <li>
                                <asp:Label ID="AnswerLabel" runat="server" AssociatedControlID="Answer">Security answer:</asp:Label>
                                <asp:TextBox ID="Answer" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="AnswerRequired" runat="server" ControlToValidate="Answer"
                                    ErrorMessage="Security answer is required." ToolTip="Security answer is required."
                                    ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                             </li>
                             <li>
                                <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">Email:</asp:Label>
                                <asp:TextBox ID="Email" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email"
                                    ErrorMessage="E-mail is required." ToolTip="E-mail is required."
                                    ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                             </li>
                        </ul>
                        <p><asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password"
                            ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match."
                            ValidationGroup="CreateUserWizard1"></asp:CompareValidator>
                        </p>
                        <p class="errorMsg"><asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal></p>
                    </fieldset>
                  
                </ContentTemplate>
            </asp:CreateUserWizardStep>
            <asp:TemplatedWizardStep ID="CreateUserWizardStep2" runat="server" >
                <ContentTemplate>
                    <fieldset>
                        <ul>
                            <li>
                                <asp:Label ID="GenderLabel" runat="server" AssociatedControlID="Gender">Gender:</asp:Label>
                                <asp:DropDownList ID="Gender" runat="server">
                                    <asp:ListItem Selected="True" Text="Female" Value="Female"></asp:ListItem>
                                    <asp:ListItem Selected="False" Text="Male" Value="Male"></asp:ListItem>
                                </asp:DropDownList>
                            </li>
                        </ul>
                    </fieldset>
                </ContentTemplate>
            </asp:TemplatedWizardStep>
            <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">
                <ContentTemplate>
                    <h3>Signup</h3>
                    <p><strong>Your account has been successfully created.</strong></p>
                    <p><asp:Button ID="ContinueButton" runat="server" CausesValidation="False" CommandName="Continue"
                        Text="Continue" ValidationGroup="CreateUserWizard1" /></p>
               
                </ContentTemplate>
            </asp:CompleteWizardStep>
        </WizardSteps>
    </asp:CreateUserWizard>
  6. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    22 Jun 2010
    Link to this post
    Hello Steven,

    As Ivan has mentioned all profile properties should be added to ManageProfile:
    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="CreateUserWizardControl.ascx.cs" Inherits="CreateUserWizardControl" %>
    <%@ Register Assembly="Telerik.Security" Namespace="Telerik.Security.WebControls" TagPrefix="sec" %>
    <h3>Signup</h3>
     <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 AssociatedControlID="Position" ID="PositionLabel" runat="server" Text="Position  <em>(optional</em> :" />
                        <asp:TextBox ID="Position" runat="server"></asp:TextBox>
                    </li>
                </ul>
            </fieldset>
        </InsertTemplate>
    </sec:ManageProfile>
    <asp:CreateUserWizard ID="CreateUserWizard1" runat="server" CreateUserButtonText="Sign up">
        <WizardSteps>
            <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">
                <ContentTemplate>
                    <fieldset>
                        <ul>
                            <li>
                                <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User name:</asp:Label>
                                <asp:TextBox ID="UserName" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
                                    ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                            </li>
                            <li>
                                <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
                                <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                                    ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                            </li>
                            <li>
                                <asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword">Confirm password:</asp:Label>
                                <asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" ControlToValidate="ConfirmPassword"
                                    ErrorMessage="Confirm Password is required." ToolTip="Confirm Password is required."
                                    ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                            </li>
                            <li>
                                <asp:Label ID="QuestionLabel" runat="server" AssociatedControlID="Question">Security question:</asp:Label>
                                <asp:TextBox ID="Question" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="QuestionRequired" runat="server" ControlToValidate="Question"
                                    ErrorMessage="Security question is required." ToolTip="Security question is required."
                                    ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                            </li>
                            <li>
                                <asp:Label ID="AnswerLabel" runat="server" AssociatedControlID="Answer">Security answer:</asp:Label>
                                <asp:TextBox ID="Answer" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="AnswerRequired" runat="server" ControlToValidate="Answer"
                                    ErrorMessage="Security answer is required." ToolTip="Security answer is required."
                                    ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                             </li>
                             <li>
                                <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">Email:</asp:Label>
                                <asp:TextBox ID="Email" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email"
                                    ErrorMessage="E-mail is required." ToolTip="E-mail is required."
                                    ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                             </li>
                        </ul>
                        <p><asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password"
                            ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match."
                            ValidationGroup="CreateUserWizard1"></asp:CompareValidator>
                        </p>
                        <p class="errorMsg"><asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal></p>
                    </fieldset>
                 
                </ContentTemplate>
            </asp:CreateUserWizardStep>
            <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">
                <ContentTemplate>
                    <h3>Signup</h3>
                    <p><strong>Your account has been successfully created.</strong></p>
                    <p><asp:Button ID="ContinueButton" runat="server" CausesValidation="False" CommandName="Continue"
                        Text="Continue" ValidationGroup="CreateUserWizard1" /></p>
              
                </ContentTemplate>
            </asp:CompleteWizardStep>
        </WizardSteps>
    </asp:CreateUserWizard>

    Where Position field is a field declared as  profile property in web.config:
    <profile defaultProvider="Sitefinity">
        <providers>
            <clear/>
            <add name="Sitefinity" connectionStringName="DefaultConnection" applicationName="/" type="Telerik.DataAccess.AspnetProviders.TelerikProfileProvider, Telerik.DataAccess"/>
        </providers>
        <properties>
            <add name="FirstName"/>
            <add name="LastName"/>
            <add name="Position"/>
            <add name="Photo_Hidden"/>
            <add name="Photo" defaultValue="~/Sitefinity/Common/Images/defaultavatar.gif"/>
            <group name="InstantMessenger">
                <add name="IM_Type"/>
                <add name="IM_Value"/>
            </group>
            <group name="Phone">
                <add name="Value"/>
                <add name="Type"/>
            </group>
        </properties>
    </profile>


    Greetings,
    Radoslav Georgiev
    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
6 posts, 0 answered