Hi,
Setting the text property for a textbox with textmode=single and multiline is pretty straight forward by giving
TextBox1.Text = "The text we want to set";
However, if we set the Textmode property to Password, then we cannot simply set the text using the TextBox.text.
In practical scenarios, we may not want to set the password for obvious reasons that password is one which we retrieve from the user and it shoult not be set.
Also, even if we set some password, the user cannot read it as it is just a sequence of dots.
If, for however, due to specific reasons, we need to set the password, then we can do the same by using the following code:-
txtpasswd.Attributes.Add("value", "the password we wish to set");
Or, if you are assigning the password from the database you can use a DataReader in place of the actual password, as follows :
txtpasswd.Attributes.Add("value", objRdr["Password"].ToString());
Cheers.