A Web server control set for passwords hides a user's entry as it is being typed. Password text boxes can only be single-line text boxes.
Using a TextBox control set for passwords can help ensure that other people will not be able to determine a user's password if they observe the user entering it. However, the password text entered is not encrypted in any way, and you should protect it as you would any other confidential data. For example, for maximum security when posting a form with a password in it, you might use Secure Sockets Layer (SSL) and encryption.
To create a password text box
Set the TextBox control's property to . In code, text modes are set using the enumeration.
Set the size of the control by setting its property to a value in pixels or its property to the number of characters to display. If you set both properties, Width takes precedence.
The Width property does not work in browsers that do not support cascading style sheet (CSS) styles.
Optionally, you can limit the number of characters the user is allowed to enter by setting the control's property. If a user exceeds this number of characters, the control stops accepting more.
You might not want to set the MaxLength property, because it can be of use to unauthorized users who are trying to guess the password.