<Textarea>
The Textarea tag renders as a multi-line text input box at run time. Use it for longer text input like descriptions, comments, and biographical information.
Example
<AddForm>
...
<table>
<tr>
<td>
<Label For="txtFirstName" Text="First Name" />
<Textbox Id="txtFirstName" DataField="FirstName" DataType="String" />
</td>
</tr>
<tr>
<td>
<Label For="txtBio" Text="Bio" />
<Textarea Id="txtBio" DataField="Bio" DataType="String" />
</td>
</tr>
<tr>
<td colspan="2">
<AddButton Text="Add"/> <CancelButton Text="Cancel"/>
</td>
</tr>
</table>
</AddForm>Properties
| Property | Values | Default | Description |
|---|---|---|---|
| ID * | string | Unique identifier for the control within the form | |
| DataField | string | Parameter name for data binding to your form's data commands | |
| DataType | String Int32 Int64 Boolean more... | String | Database type for data commands |
| AccessKey | string | Keyboard shortcut character (e.g. F for Alt+F) | |
| CharacterCount | None CountDown CountUp | None | Displays a character count near the control |
| CharacterCountClass | string | CSS class for the character count display | |
| CharacterCountLabel | string | Label text shown next to the character count | |
| Columns | integer | Display width of the control in characters | |
| CssClass | string | CSS class name(s) for styling the control | |
| Enabled | True False | True | When False, the control is disabled (grayed out and not interactive). Different from ReadOnly, which still allows focus and selection |
| Height | size | Height of the control | |
| HtmlEncode | True False | False | HTML-encodes content before sending to the SubmitCommand |
| MaxLength | integer | Maximum character count for the CharacterCount feature | |
| Nullable | True False | False | Returns DBNull when the control is blank or whitespace |
| Placeholder | string | Hint text displayed when the control is empty | |
| ReadOnly | True False | False | Prevents the user from changing the contents |
| Rows | integer | Number of visible lines displayed in the control | |
| Style | string | Inline CSS (e.g. color: red; border: solid 1px black;) | |
| TabIndex | integer | Tab order for keyboard navigation | |
| ToolTip | string | Text displayed on mouse hover | |
| Visible | True False | True | Shows or hides the control |
| Width | size | Width of the control | |
| Wrap | True False | True | Whether text wraps within the control |
* Required property
Deprecated Properties
These properties use ASP.NET inline styling and are no longer recommended for modern web development. Use the CssClass property to apply CSS classes or the Style property for inline CSS instead.
| Property | Values | Description |
|---|---|---|
| BackColor | color name | #dddddd | Background color of the control |
| BorderColor | color name | #dddddd | Border color of the control |
| BorderStyle | NotSet None Dotted Dashed Solid Double Groove Ridge Inset Outset | Border style of the control |
| BorderWidth | size | Border width of the control |
| Font-Bold | True False | Bold text |
| Font-Italic | True False | Italic text |
| Font-Names | string | Font family name |
| Font-Overline | True False | Overline text decoration |
| Font-Size | XX-Small X-Small Small Medium Large X-Large XX-Large or size | Font size |
| Font-Strikeout | True False | Strikethrough text decoration |
| Font-Underline | True False | Underline text decoration |
| ForeColor | color name | #dddddd | Text color of the control |
Property Details
ID: Name, consisting of letters and numbers, beginning with a letter, that uniquely identifies the control within the form.
DataField: Name of the parameter in the
<SubmitCommand>which will be filled with this control's data when the form is submitted and/or the parameter in the<SelectCommand>which will supply this control's data when the form is loaded. This attribute is required if the control will participate in operations with your form's data commands.DataType: The type of data this control is supplying to the data commands. This is a Database type. This attribute is required if the control will participate in operations with your form's data commands.
CharacterCount: When set to
CountUp, the number of characters the user has typed will be displayed just after the control. When set toCountDown, the number of characters remaining will be displayed, calculated based on theMaxLengthproperty. This feature requires JavaScript and jQuery.CharacterCountClass: When
CharacterCountisCountUporCountDown, you can style the displayed number and theCharacterCountLabel(if specified) by providing a CSS class name for this property.CharacterCountLabel: Text to be displayed next to the character count number. This label is only displayed when
CharacterCountis set toCountUporCountDown.TIP
Precede your label text with a space. Otherwise the text will be flush against the character count number.
HtmlEncode: When set to True, the content of the control will be HTML-encoded before sending it to the SubmitCommand for processing. This can help protect against scripting attacks but will also enlarge the size of the text that is saved — for instance,
<becomes<.MaxLength: For use with the
CharacterCountfeature only. Specifies the maximum number of characters theCharacterCountfeature should allow. If not specified, the user's input will not be limited.IMPORTANT
Unlike the Textbox's MaxLength attribute, this does not ensure that no more than the specified number of characters will be entered. You should still use normal validation methods for that.
Nullable: If True, the control will return a DBNull value if the control is blank or contains just whitespace. If a DBNull value is passed to the control, the control will be set to an empty string.
Placeholder: The value will be displayed in the textarea when it is empty, providing explanatory text prior to user input. For instance, an About Me textarea might use "Tell us about yourself" as the Placeholder. When the user tabs into the control, the text disappears. If the user tabs out without entering anything, the placeholder text re-appears. This is not a default value and will not be sent to the database.