Monday, September 14, 2009

ASP.Net Setting Text for a Textbox with TextMode = Password

When one sets the Text property in a TextBox with TextMode = Password, the default behaviour is to render the TextBox empty.
Basically for security reasons and that's the normal and correct behaviour.
But and there is always a BUTT, one may want to set the Text in a TextBox with TextMode = Password.
The way to do it is as follows:

txtPwd.Attributes.Add("value", customer.Password);

No comments:

Post a Comment