TextAreaExtensions.TextArea Method (HtmlHelper, String, String, Int32, Int32, IDictionary<String, Object>)

Returns the specified textarea element by using the specified HTML helper, the name of the form field, the text content, the number of rows and columns, and the specified HTML attributes.

Namespace:  System.Web.Mvc.Html
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

public static string TextArea(
	this HtmlHelper htmlHelper,
	string name,
	string value,
	int rows,
	int columns,
	IDictionary<string, Object> htmlAttributes


Type: System.Web.Mvc.HtmlHelper
The HTML helper instance that this method extends.
Type: System.String
The name of the form field.
Type: System.String
The text content.
Type: System.Int32
The number of rows.
Type: System.Int32
The number of columns.
Type: System.Collections.Generic.IDictionary<String, Object>
The HTML attributes of the element.

Return Value

Type: System.String
The textarea element.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type HtmlHelper. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

A text area is a text box that enables the user to enter multiple lines of text. If you want to limit the user to one line of text, you should use the TextBox method instead.

Community Additions