开发者

Initialize TextBox with the Password TextMode

开发者 https://www.devze.com 2023-04-12 01:49 出处:网络
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.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消