I'm trying to initialize the TextBox with the Password TextMode in 开发者_运维知识库my C# code. I do it in Page_Load function. But after the output in a browser there is no text.
this.passwordTextBox.Text = this.GetData().Password;
this.confirmPasswordTextBox.Text = this.GetData().Password;
How can I assing a value to this property?
You can set the password using:
this.passwordTextBox.Attributes["value"] = this.GetData().Password;
or
this.passwordTextBox.Attributes.Add("value", this.GetData().Password);
Setting the Value of a TextBox with TextMode=Password
精彩评论