Controls You Can Use on Web Forms ASP.NET Standard Controls TextBox Control
A multi-line TextBox control allows users to type information into a box that supports word wrap and vertical and horizontal scrolling.
- Set the TextBox control’s TextMode property to MultiLine. In code, text modes are set using the TextBoxMode enumeration.
- Set the size of the control by setting the following properties:
- Width to a value in pixels or Columns to the number of characters to display.
- Height to a value in pixels or Rows to the number of rows.
NOTE: The Height and Width properties do not work in browsers that do not support CSS styles.
Setting these properties does not limit the number of characters or rows the user can enter, only how many will display. Height and Width take precedence over Rows and Columns.
NOTE: By default, a multiline TextBox control displays a vertical scroll bar. To control scroll bar behavior, use the CSS overflow style attribute.
- Optionally set word-wrap behavior by setting the control’s Wrap property.
By default, text wraps automatically without embedding carriage-return/linefeed characters. If set to false, the text does not wrap and the user must press Enter to start a new line, which embeds a carriage-return/linefeed character. Setting Wrap to false causes the control to display a horizontal scrollbar.
Enter your comments:
<asp:textbox id="comments" runat="server"
textmode="multiline" rows=10 />
Show me
NOTE: The MaxLength property has no effect in a multi-line textbox.
Setting a TextBox Control for Password Entry Responding to Changes in a TextBox Control