ASP.NET TextMode Property

Definition and Usage

The TextMode property is used to set or return the behavior mode of the TextBox control.

Syntax

<asp:TextBox TextMode="mode" runat="server" />
Property Description
mode

One of the TextBoxMode enumeration values. The default value is SingleLine.

Possible Values:

  • SingleLine - Default. Represents single-line input mode.
  • MultiLine - Represents multi-line input mode.
  • Password - Represents password input mode.

Example

The following example sets the text mode of the TextBox control to "Password":

<form runat="server">
<asp:TextBox id="tb1" runat="server" TextMode="Password" />
</form>

Example

Set the TextMode Property of TextBox Control