Friday, September 28, 2007

Populating a Password Textbox at Runtime

Having an with a password property (TextMode="Password"), you cannot simply set the textbox's .Text attribute at runtime to populate the control with a value. Rather, you have to do the following:


this.txtPassword.Attributes["value"] = {whatever value from variable or DB}

Many thanks to:
http://aspadvice.com/blogs/joteke/archive/2005/02/03/_4000_ASP.NET-Forums_3A00_-How-to-set-text-to-a-Password-TextBox_3F00_.aspx

No comments: