ASP.NET HtmlTextArea Control

Definition and Usage

The HtmlTextArea control is used to control the <textarea> element. In HTML, the <textarea> element is used to create a text area.

Properties

Properties Description
Attributes Returns all attribute names and value pairs of the element.
Cols The number of columns of the text field.
Disabled Boolean value indicating whether the control is disabled. The default is false.
id The unique id of the control.
InnerHtml

Sets or returns the content between the start and end tags of the HTML element.

Special characters are not automatically converted to HTML entities.

InnerText

Sets or returns all text between the start and end tags of the HTML element.

Special characters are automatically converted to HTML entities.

Name The unique name of the text field.
OnServerChange The name of the function executed when the content of the text field is modified.
Rows The number of visible lines of the text field.
runat Specifies that the control is a server control. It must be set to "server".
Style Sets or returns the CSS properties applied to the control.
TagName Returns the tag name of the element.
Value The value of the text field.
Visible Boolean value indicating whether the control is visible.

Example

HTMLTextarea
In this example, we declare an HtmlTextarea control, an HtmlInputButton control, and an HtmlGeneric control in the .aspx file. When the submit button is triggered, the submit subroutine is executed. This submit subroutine sends the message "You wrote: " and the text entered by the user in the text box to the p element.