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 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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>
- TextBox example: how to use TextBox control in asp.net
- TextBox example: how to use TextMode property MultiLine
- TextBox example: using OnTextChanged event with AutoPostBack
- Literal example: how to use Mode Encode, PassThrough, Transform
- AccessKey example: how to use AccessKey in asp.net
- Asp.Net Code Behind Model Example
- Asp.Net Inline Coding Model Example
- BulletedList control example
- Panel example: how to use Panel control in asp.net