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

Forums / Developing with Sitefinity / CreateUserWizard Update Data

CreateUserWizard Update Data

6 posts, 1 answered
  1. Leandro Almeida
    Leandro Almeida avatar
    5 posts
    Registered:
    03 Feb 2010
    09 Mar 2010
    Link to this post
    Good afternoon,

    I created a CreateUserWizard control to insert users, but now I want them to change their data, how can I do this?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    09 Mar 2010
    Link to this post
    Hi Leandro Almeida,

    1. There is a built-in control that you can use - ManageProfile that is located in Login section of controls' Toolbox
    2. You can create a custom control where you use ProfileBase class and its methods.

    All the best,
    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. Leandro Almeida
    Leandro Almeida avatar
    5 posts
    Registered:
    03 Feb 2010
    10 Mar 2010
    Link to this post
    Hi, I have the following ManageProfile:

    <sec:ManageProfile ID="mngProfile" runat="server" Mode="Edit" GenerateButtonsInDefaultTemplate="false">
      <EditTemplate>
         <asp:TextBox ID="Nome" runat="server" MaxLength="100"></asp:TextBox>
      <EditTemplate>
      <InsertTemplate>
         <asp:TextBox ID="Nome" runat="server" MaxLength="100"></asp:TextBox>
      </InsertTemplate>
    </sec:ManageProfile>

    And i use this code to change de Mode:

    mngProfile.Mode = Telerik.Security.WebControls.ManageProfile.Modes.Edit;


    Great, It works!!
    But I can not update the User. Do you have any piece of code??
  4. Leandro Almeida
    Leandro Almeida avatar
    5 posts
    Registered:
    03 Feb 2010
    10 Mar 2010
    Link to this post
    Good morning, I have another question.

    When you edit the User, use the following code to populate the controls:

    mngProfile.Username = UserManager.GetCurrentUserName();

    In Textbox works, but the DropDownList does not work and still pulls out all the Items that had the DropDown.
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    10 Mar 2010
    Link to this post
    Hello Leandro Almeida,

    Here is a sample that illustrates how to switch the modes and set the property value

    <div runat="server" id="cnt1">
     <sec:ManageProfile ID="ManageProfile" runat="server" Mode="Insert">
        <InsertTemplate>
            <fieldset>
                <ul>
                    <li>
                    insert
                        <asp:Label AssociatedControlID="FirstName" ID="FirstNameLabel" runat="server" Text="First name " />
                        <asp:TextBox ID="FirstName" runat="server" />              
                    </li>
                </ul>
            </fieldset>
        </InsertTemplate>
        <EditTemplate>
        <fieldset>
            <ul>
              <li>
              edit
                <asp:Label AssociatedControlID="FirstName" ID="FirstNameLabel" runat="server" Text="First name" />
                <asp:TextBox ID="FirstName" runat="server" />              
                 </li>
            </ul>
        </fieldset>
        </EditTemplate>
         
    </sec:ManageProfile>
    </div>
     
     
    <asp:Button runat="server" ID="submitButton" Text="Submit" />
    <asp:Button runat="server" ID="ManageProfileMode" Text="ChangeMode" />

    protected void Page_Load(object sender, EventArgs e)
    {
     
        submitButton.Click += new EventHandler(Submit_Click);
        ManageProfileMode.Click += new EventHandler(ManageProfileMode_Click);
     
     
     }
     void ManageProfileMode_Click(object sender, EventArgs e)
    {
     
        ManageProfile.Mode = Telerik.Security.WebControls.ManageProfile.Modes.Edit;
     
    }
     
    void Submit_Click(object sender, EventArgs e)
    {
        ManageProfile.SetProfileProperties(UserManager.GetCurrentUserName());
    }

    as for the second issue, most probably you are not populating the DropDownList items correctly.

    Sincerely yours,
    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.
    Answered
  6. Leandro Almeida
    Leandro Almeida avatar
    5 posts
    Registered:
    03 Feb 2010
    10 Mar 2010
    Link to this post
    It works !!!!!! I scored as the correct answer !!!!!


    Now only got the problem to load the dropdownlist that I described


    Tks !!!!!!!!!

Register for webinar
6 posts, 1 answered