我正在尝试在我的 C# 代码中使用密码 TextMode 初始化 TextBox。我在 Page_Load 函数中执行此操作。但是在浏览器中输出后没有文字。
this.passwordTextBox.Text = this.GetData().Password;
this.confirmPasswordTextBox.Text = this.GetData().Password;
如何为该属性赋值?
最佳答案
您可以使用以下方式设置密码:
this.passwordTextBox.Attributes["value"] = this.GetData().Password;
或
this.passwordTextBox.Attributes.Add("value", this.GetData().Password);
关于c# - 使用密码 TextMode 初始化 TextBox,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7709243/