Accessing Password info in the Create User Wizard

Last post 05-14-2008 1:40 PM by anas. 6 replies.

Sort Posts:

  • Accessing Password info in the Create User Wizard

    05-08-2008, 5:11 PM
    • Loading...
    • rap2
    • Joined on 05-08-2008, 9:04 PM
    • Posts 3

    I am working on an admin page that allowthe aministrator to create a user among other things. To avoid double entry I am trying to populate an additional form with information from the create user wizard.  I have no problem with any of the  fields except the password field.  I can not get it to show the password in a seperate text box.  I am sure this is some kind of security isse but I would think this would not be this hard to figure out. 

    I have tried this code

    UserPasswordconftxbx.text = CreateUserWizard1.password

     

    The UserPasswordconftxbx just shows up blank. This same code works fine for user and email, etc......

    Any Suggestions?

  • Re: Accessing Password info in the Create User Wizard

    05-08-2008, 5:29 PM
    • Loading...
    • anas
    • Joined on 09-21-2006, 8:31 AM
    • Palestine - فلسطين
    • Posts 2,502

    HI,

    Try to use the TextBox Value attribute as follows:

    UserPasswordconftxbx.attributes("value")= CreateUserWizard1.password

     

    Best Regards,

    Anas Ghanem - انس الغانم | My Blog
  • Re: Accessing Password info in the Create User Wizard

    05-08-2008, 5:40 PM
    • Loading...
    • rap2
    • Joined on 05-08-2008, 9:04 PM
    • Posts 3

    Still will not show the value.  This is the entire sub at this point. All works except for what I have Bolded out:

      Protected Sub ContinueButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)

    Unlbl.Visible = True

    unctxbx.Visible = True

    unctxbx.Text = CreateUserWizard1.UserName

    useridlbl.Visible = True

    uidcnftxbx.Visible = True

    uidcnftxbx.Attributes("value") = CreateUserWizard1.Password

    emailcnflbl.Visible = True

    emailcnftxbx.Visible = True

    emailcnftxbx.Text = CreateUserWizard1.Email

    noconsendbut.Visible = True

    conemailbut.Visible = True

     

     

    End Sub

  • Re: Accessing Password info in the Create User Wizard

    05-08-2008, 5:54 PM
    • Loading...
    • anas
    • Joined on 09-21-2006, 8:31 AM
    • Palestine - فلسطين
    • Posts 2,502

    Hi,

    I'm not sure why you want to populate this textboxes while you have the values in CreateUserWizard,

    any way you can  try this :

     

                Dim pwd as string=Request.Form("CreateUserWizard1$CreateUserStepContainer$Password")
                If Not string.IsNullOrEmpty(pwd)
                    UserPasswordconftxbx.attributes("value")=pwd
                End If
     
    Best Regards,

    Anas Ghanem - انس الغانم | My Blog
  • Re: Accessing Password info in the Create User Wizard

    05-08-2008, 6:58 PM
    • Loading...
    • rap2
    • Joined on 05-08-2008, 9:04 PM
    • Posts 3

    Thank you for helping but neither of those solutions will work. I am trying to populate fields (textboxes) in a seperate form so that they can be used to create other data I need as an admin and to be included in an email sent to the user .  Has to be some kind of security issue in the password control. Any other ideas?

  • Re: Accessing Password info in the Create User Wizard

    05-13-2008, 6:20 AM

    rap2:
    Thank you for helping but neither of those solutions will work. I am trying to populate fields (textboxes) in a seperate form so that they can be used to create other data I need as an admin and to be included in an email sent to the user .  Has to be some kind of security issue in the password control. Any other ideas?

    Hi rap2,

    Please check this link, perhaps it could helps,

            private void WritePasswordPanel(HtmlTextWriter writer, CreateUserWizard wizard)
            {
                TextBox textBox = wizard.FindControl("CreateUserStepContainer").FindControl("Password") as TextBox;
                if (textBox != null)
                {
                    Page.ClientScript.RegisterForEventValidation(textBox.UniqueID);

                    WebControlAdapterExtender.WriteBeginDiv(writer, "AspNet-CreateUserWizard-PasswordPanel", "");
                    Extender.WriteTextBox(writer, true, wizard.LabelStyle.CssClass, wizard.PasswordLabelText, wizard.TextBoxStyle.CssClass, "CreateUserStepContainer_Password", "");
                    WebControlAdapterExtender.WriteRequiredFieldValidator(writer, wizard.FindControl("CreateUserStepContainer").FindControl("PasswordRequired") as RequiredFieldValidator, wizard.ValidatorTextStyle.CssClass, "Password", wizard.PasswordRequiredErrorMessage);
                    WebControlAdapterExtender.WriteEndDiv(writer);
                }
            }

    http://www.koders.com/csharp/fid4C369811990930B013948A06A94BEC41F9D83E9B.aspx?s=CreateUserWizard.Password

    Hope it helps,

    Hong Gang

    Sincerely,
    Hong Gang Chen
    Microsoft Online Community Support
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
  • Re: Accessing Password info in the Create User Wizard

    05-14-2008, 1:40 PM
    • Loading...
    • anas
    • Joined on 09-21-2006, 8:31 AM
    • Palestine - فلسطين
    • Posts 2,502

    rap2:

    Thank you for helping but neither of those solutions will work. I am trying to populate fields (textboxes) in a seperate form so that they can be used to create other data I need as an admin and to be included in an email sent to the user .  Has to be some kind of security issue in the password control. Any other ideas?

    You need to make sure that you the Membership "EnablePasswordRetrieval" property to true , so that you can use Membership.GetPassword method:

    set the Property in membershipProvider Settings  in web.config ,

        <membership defaultProvider="SqlMembershipProvider" userIsOnlineTimeWindow="15">
          <providers>
            <clear/>
            <add name="SqlMembershipProvider" 
                 type="System.Web.Security.SqlMembershipProvider" 
                 connectionStringName="ASPNETSECURITY" 
                 applicationName="Development" 
                 enablePasswordRetrieval="true" 
                 enablePasswordReset="false" 
                 requiresQuestionAndAnswer="false" 
                 requiresUniqueEmail="true" 
                 passwordFormat="Clear" 
                 minRequiredPasswordLength="1" 
                 />
          </providers>
        </membership>
     

    then you can Print the Authenticated  User data  as follows:

          if (Request.IsAuthenticated)
            { 
                MembershipUser usr=Membership.GetUser();
                Response.Write("<b>UserName</b> " + usr.UserName);
                Response.Write("<br/>");
                Response.Write("<b>Password </b> " + usr.GetPassword());
                Response.Write("<br/>");
                Response.Write("<b> LastActivity </b> " + usr.LastActivityDate.ToShortDateString());
            }
    

    Hope that Helps

    Best Regards,

    Anas Ghanem - انس الغانم | My Blog
Page 1 of 1 (7 items)