System.Web.UI.HtmlControls.HtmlTextArea Class

Allows programmatic access to the <textarea> HTML element on the server.

See Also: HtmlTextArea Members


public class HtmlTextArea : HtmlContainerControl, System.Web.UI.IPostBackDataHandler


The System.Web.UI.HtmlControls.HtmlTextArea control corresponds to the <textarea> HTML element that allows you to create a multiline text box on a Web page. Use this control to programmatically manipulate a <textarea> HTML element.

This class allows you to control the height and width of a multiline text box by setting the HtmlTextArea.Rows and HtmlTextArea.Cols properties, respectively. You also can assign a name to the control by setting the HtmlTextArea.Name property. To determine or specify the text in the text box, use the HtmlTextArea.Value property.

The System.Web.UI.HtmlControls.HtmlTextArea class provides a HtmlTextArea.ServerChange event that allows you to perform a custom set of instructions every time the value of the text box changes between posts to the server. This event is commonly used for data validation.


If you want to create a single-line text box, use the System.Web.UI.HtmlControls.HtmlInputText control.

For a list of initial property values for an instance of System.Web.UI.HtmlControls.HtmlTextArea, see the HtmlTextArea.#ctor constructor.


This control can be used to display user input, which might include malicious client script. Check any information that is sent from a client for executable script, SQL statements, or other code before displaying it in your application. ASP.NET provides an input request validation feature to block script and HTML in user input. Validation server controls are also provided to assess user input. For more information, see [<topic://cpconASPNETSyntaxForValidationControls>].


Namespace: System.Web.UI.HtmlControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0,