private void CreatePasswordField(HtmlGenericControl container) { using (HtmlGenericControl field = HtmlControlHelper.GetField()) { using ( HtmlGenericControl label = HtmlControlHelper.GetLabel(Titles.EnterNewPassword, "PasswordInputPassword")) { field.Controls.Add(label); } this.passwordInputPassword = new HtmlInputPassword(); this.passwordInputPassword.ID = "PasswordInputPassword"; field.Controls.Add(this.passwordInputPassword); container.Controls.Add(field); } }
private static void AddPasswordField(HtmlGenericControl container) { using (HtmlGenericControl field = new HtmlGenericControl("div")) { field.Attributes.Add("class", "field"); using (HtmlGenericControl label = HtmlControlHelper.GetLabel(Titles.Password, "PasswordInputPassword")) { field.Controls.Add(label); } using (HtmlInputPassword passwordInputPassword = new HtmlInputPassword()) { passwordInputPassword.ID = "PasswordInputPassword"; passwordInputPassword.Attributes.Add("placeholder", Titles.Password); field.Controls.Add(passwordInputPassword); } container.Controls.Add(field); } }
private void CreateNewPasswordField(HtmlGenericControl container) { using (HtmlGenericControl field = HtmlControlHelper.GetField()) { using (HtmlGenericControl label = HtmlControlHelper.GetLabel(Titles.NewPassword, "NewPasswordInputPassword")) { field.Controls.Add(label); } using (HtmlGenericControl iconInput = HtmlControlHelper.GetLeftIconInput()) { this.newPasswordInputPassword = new HtmlInputPassword(); this.newPasswordInputPassword.ID = "NewPasswordInputPassword"; iconInput.Controls.Add(this.newPasswordInputPassword); using (HtmlGenericControl icon = HtmlControlHelper.GetIcon("key icon")) { iconInput.Controls.Add(icon); } field.Controls.Add(iconInput); } container.Controls.Add(field); } }
private void Dispose(bool disposing) { if (!disposing) { return; } if (this.changePasswordButton != null) { this.changePasswordButton.Dispose(); this.changePasswordButton = null; } if (this.confirmPasswordInputPassword != null) { this.confirmPasswordInputPassword.Dispose(); this.confirmPasswordInputPassword = null; } if (this.errorMessage != null) { this.errorMessage.Dispose(); this.errorMessage = null; } if (this.message != null) { this.message.Dispose(); this.message = null; } if (this.newPasswordInputPassword != null) { this.newPasswordInputPassword.Dispose(); this.newPasswordInputPassword = null; } if (this.passwordInputPassword != null) { this.passwordInputPassword.Dispose(); this.passwordInputPassword = null; } this.disposed = true; }
public void DefaultProperties () { HtmlInputPassword it = new HtmlInputPassword (); Assert.AreEqual (defaultAttributesCount, it.Attributes.Count, "Attributes.Count"); Assert.AreEqual ("password", it.Type, "Type"); Assert.AreEqual (String.Empty, it.Value, "Value"); Assert.AreEqual ("input", it.TagName, "TagName"); Assert.AreEqual (defaultAttributesCount, it.Attributes.Count, "Attributes.Count-2"); }