Controls You Can Use on Web Forms ASP.NET Standard Controls TextBox Control
A TextBox Web server control set for passwords hides a user’s entry as it is being typed. Password textboxes can only be single-line textboxes.
NOTE: 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. The password entry itself, though, is not encrypted in any way. For maximum security when posting a form with confidential data, consider using Secure Sockets Layer ( SSL ) and encryption.
- Set the TextBox control’s TextMode property to Password. In code, text modes are set using the TextBoxMode enumeration.
- Set the size of the control by setting its Width property to a value in pixels or its Columns property to the number of characters to display. If you set both properties, Width takes precedence.
NOTE: The Width property does not work in browsers that do not support CSS styles.
- Optionally, you can limit the number of characters the user is allowed to enter by setting the control’s MaxLength property. If the users exceed this number of characters, the control stops accepting more.
NOTE: Setting the MaxLength property can be of use to unauthorized users who are attempting to decode the password.
Enter Password: <asp:textbox id="pass" runat="server"
textmode="password"
width=10 maxlength=8 />
Introduction to the TextBox Control Specifying Multiline Input for a TextBox Control