How to use password mode TextBox in asp.net

TextBox TextMode Property Password
ASP.NET TextBox web server control is a simple text input box. But you can change it's text input mode to password input field. TextBox web server control's TextMode property help you to create password input control. Set the TextBox TextMode property value Password, then TextBox will act as a password input TextBox.

Password input TextBox hides user input as it being typed. Password input TextBox can only be single line TextBox. We can get password input TextBox text by collecting TextBox Text property value.
TextModePassword.aspx

<%@ Page Language="C#" %>

<!DOCTYPE html>

<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>TextBox example: how to use TextMode property Password</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label ID="Label1" runat="server" Text="Email" AssociatedControlID="TextBox1"></asp:Label>
        <asp:TextBox ID="TextBox1" runat="server" TextMode="SingleLine"></asp:TextBox>
        <br />
        <asp:Label ID="Label2" runat="server" Text="Password" AssociatedControlID="TextBox2"></asp:Label>
        <asp:TextBox ID="TextBox2" runat="server" TextMode="Password"></asp:TextBox>
        <br />
        <asp:Button ID="Button1" runat="server" Text="Login" />
    </div>
    </form>
</body>
</html>
Related asp.net examples