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

Forums / Developing with Sitefinity / CreateWizardUser explains

CreateWizardUser explains

14 posts, 0 answered
  1. Pierre
    Pierre avatar
    433 posts
    Registered:
    16 Feb 2006
    08 Mar 2010
    Link to this post
    Hi team,

    I' working modifiing the CreateWizardUser control and i need some explains about perfect use. In this control out of box your are created 2 levels : ManageProfile section(Mode insert) with Insert template  and CreateUserWizard section. I have added many items in my user profil but where to place insert or wizard section?. More,

    - the items added in Manageprofil section are not exposed backside like added dropdownlists or new profile items like Company,Country. Exist some way to use backside or Findcontrols, need use recursive methods?.

    - the items added in CreateWizard section like Labels or more profile items how to find the controls to change backside. For sample i have added a label to control if emails exist but not firing backside.
     
    - To use another profil item as default connection one of best suggestions is use CreateUserWizard1.UserName = CreateUserWizard1.Email for Email but What about use my properties not exposed in the wizard like
    CreateUserWizard1.UserName = CreateUserWizard1.IDUser<-no firing.

    Regards.
     

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    09 Mar 2010
    Link to this post
    Hello Pierre,

    Your properties should be added to the ContentTemplate of CreateUserWizard control. Generally these properties should be a Memebership data, because they are persisted by MembershipUser object. The profile data is persisted by ProfileBase class which is used ManageProfile custom control.

    ManageUsers has containers that you can use to find a given control - EditContainer, ListContainer.

    Telerik.Security.WebControls.ManageUsers.ListContainer listContainer = manageUsers.GetCurrentContainer() as Telerik.Security.WebControls.ManageUsers.ListContainer;
            if (listContainer != null)
            {
                    CheckBox someCheckBox= (CheckBox)listContainer.FindControl("someCheckBox");
      
            }


    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. Pierre
    Pierre avatar
    433 posts
    Registered:
    16 Feb 2006
    10 Mar 2010
    Link to this post
    Hi,

    About replace UserName by other Items of profil to use as Default like Email :

    I have tested is this solution
    protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            if (!String.IsNullOrEmpty(CreateUserWizard1.Email))
            {
                // user email as username
                //hidden in this case Username of aspx
                CreateUserWizard1.UserName = CreateUserWizard1.Email;
            }
    And the WIzard is postbacking but not registering the User. I have tested OnCreateUser and OnCreatingUser to replace but same. Could you suggest the best solution to replace UserName  as Default Login in the Wizard plz.

    Thanks, Romi
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    10 Mar 2010
    Link to this post
    Hello Pierre,

    I checked the control behavior once again and there were not problems to set the username as email. Here is my template

    <asp:CreateUserWizard ID="CreateUserWizard1"  runat="server"  CreateUserButtonText="Sign up"  CreateUserButtonStyle-CssClass="test" >
        <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"  Visible="false" runat="server" AutoPostBack="true"></asp:TextBox>                        
                            </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>
     
     
                            ....
                              .....

    Note that the RequiredFieldValidator should be removed.

    Here is the Page_Load method I used

    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);
        // if the email is not empty I set it as "UserName"
        if (!String.IsNullOrEmpty(CreateUserWizard1.Email))
        {
            CreateUserWizard1.UserName = CreateUserWizard1.Email;
        }
    }


    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.
  5. Pierre
    Pierre avatar
    433 posts
    Registered:
    16 Feb 2006
    10 Mar 2010
    Link to this post
    Hi Ivan,

    Yes,I use your code and no fieldvalidator but is not registering the user, always error message. But if add some text in Username fire !?. No other place to use?

    Regards
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    10 Mar 2010
    Link to this post
    Hello Pierre,

    What  is the error message you are getting? If you attach the code to debugger are there any stack?

    Greetings,
    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.
  7. Pierre
    Pierre avatar
    433 posts
    Registered:
    16 Feb 2006
    10 Mar 2010
    Link to this post
    Hi,

    No debug code only standard wizard error message in ID=ErrorMessage like the acount is not created, you must try again.No other fieldvalidator add only atxt in Username and fire.

    Thanks.

    Added: Is not firing the first time but after one second send pushed is firing.
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    10 Mar 2010
    Link to this post
    Hi Pierre,

    I am sending you a control that works fine at my end.

    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.
  9. Pierre
    Pierre avatar
    433 posts
    Registered:
    16 Feb 2006
    11 Mar 2010
    Link to this post
    Hi,

    Tested inside a defaut template and have same issue. The account is not created at first Sign UP, a standard error message is send botton using the designer error "UnknownErrorMessage". After this if you sign Up a second time is fired. I use last sp2.

    regards.

  10. Pierre
    Pierre avatar
    433 posts
    Registered:
    16 Feb 2006
    11 Mar 2010
    Link to this post
    Hi,
    Ok is fixed. Need to subscribe CreatingUser event to add the Email to Username before. Thanks Ivan.
     
    protected override void OnInit(EventArgs e)
       {
           base.OnInit(e);
     
           this.CreateUserWizard1.CreatedUser += new EventHandler(CreateUserWizard1_CreatedUser);
           this.CreateUserWizard1.CreatingUser += new LoginCancelEventHandler(CreateUserWizard1_CreatingUser);
           //SUBSCRIBE FOR SENDINGMAIL EVENT
           this.CreateUserWizard1.SendingMail += new MailMessageEventHandler(CreateUserWizard1_SendingMail);
     
       }
       void CreateUserWizard1_CreatingUser(object sender, LoginCancelEventArgs e)
       {
           if (!String.IsNullOrEmpty(CreateUserWizard1.Email))
           {
               CreateUserWizard1.UserName = CreateUserWizard1.Email;
           }
      }
  11. Pierre
    Pierre avatar
    433 posts
    Registered:
    16 Feb 2006
    16 Mar 2010
    Link to this post
    Hi Team,

    I have a new question about Confirm subscription by Email. I have used the BLOG post to create but have some complementary questions.

    I have registred one user and the message final is here."..You need to confirm...", but this user before the confirm email is in status Logged!. If i use F5 after this confirmation step or push continue button i can see the user logged in. How to prevent No login if no confirm by email.

    Thanks.
  12. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    16 Mar 2010
    Link to this post
    Hello Pierre,

    Yo have to use MembershipUser.IsApproved Property  - Gets or sets whether the membership user can be authenticated. Also set LoginCreatedUser  property of CreateUserWizard control to false. The property gets or sets a value indicating whether to log in the new user after creating the user account

    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.
  13. Vimalarajah
    Vimalarajah avatar
    4 posts
    Registered:
    28 Sep 2010
    12 Oct 2010
    Link to this post
    Hi Team,

    I also having a smiler kind of a problem that is I want to validate the user registration with the web service other than the data base to which the application is connected.
     
    If anyone can pls reply to my post.

    Thanks in advance.
  14. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    12 Oct 2010
    Link to this post
    Hi Vimalarajah,

    You have to subscribe for CreateUserWizard.CreatingUser Event and then call your web service. After that you can cancel the process of creating a new user or proceed with adding the user to the membership provider.

    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
14 posts, 0 answered