StatCounter

View My Stats

Wednesday, February 6, 2008

Text Box Initialization when it is Password Mode in .NET

Text Box Initialization when it is Password Mode in .NET


If u r having a textbox in a form.The textmode of the textbox is Password.

Under this type of situation if u want to initialize a password while the page load we will normally gave at the Page_Load

TextBox1.Text="Hi";

But the above wont't work when the TextBox mode is set to password. To do this write the below code at the page Load

TextBox1.Attributes.Add("value","Hi"); //This work Fine

No comments: