Table of Contents

Class TextAreaExtensions

Namespace
System.Web.Mvc.Html
Assembly
System.Web.Mvc.dll

Represents support for HTML textarea controls.

public static class TextAreaExtensions
Inheritance
TextAreaExtensions
Inherited Members

Methods

TextArea(HtmlHelper, string)

Returns the specified textarea element by using the specified HTML helper and the name of the form field.

public static MvcHtmlString TextArea(this HtmlHelper htmlHelper, string name)

Parameters

htmlHelper HtmlHelper

The HTML helper instance that this method extends.

name string

The name of the form field to return.

Returns

MvcHtmlString

The textarea element.

TextArea(HtmlHelper, string, IDictionary<string, object>)

Returns the specified textarea element by using the specified HTML helper, the name of the form field, and the specified HTML attributes.

public static MvcHtmlString TextArea(this HtmlHelper htmlHelper, string name, IDictionary<string, object> htmlAttributes)

Parameters

htmlHelper HtmlHelper

The HTML helper instance that this method extends.

name string

The name of the form field to return.

htmlAttributes IDictionary<string, object>

An object that contains the HTML attributes to set for the element.

Returns

MvcHtmlString

The textarea element.

TextArea(HtmlHelper, string, object)

Returns the specified textarea element by using the specified HTML helper and HTML attributes.

public static MvcHtmlString TextArea(this HtmlHelper htmlHelper, string name, object htmlAttributes)

Parameters

htmlHelper HtmlHelper

The HTML helper instance that this method extends.

name string

The name of the form field to return.

htmlAttributes object

An object that contains the HTML attributes to set for the element.

Returns

MvcHtmlString

The textarea element.

TextArea(HtmlHelper, string, string)

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

public static MvcHtmlString TextArea(this HtmlHelper htmlHelper, string name, string value)

Parameters

htmlHelper HtmlHelper

The HTML helper instance that this method extends.

name string

The name of the form field to return.

value string

The text content.

Returns

MvcHtmlString

The textarea element.

TextArea(HtmlHelper, string, string, IDictionary<string, object>)

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

public static MvcHtmlString TextArea(this HtmlHelper htmlHelper, string name, string value, IDictionary<string, object> htmlAttributes)

Parameters

htmlHelper HtmlHelper

The HTML helper instance that this method extends.

name string

The name of the form field to return.

value string

The text content.

htmlAttributes IDictionary<string, object>

An object that contains the HTML attributes to set for the element.

Returns

MvcHtmlString

The textarea element.

TextArea(HtmlHelper, string, string, int, int, 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.

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

Parameters

htmlHelper HtmlHelper

The HTML helper instance that this method extends.

name string

The name of the form field to return.

value string

The text content.

rows int

The number of rows.

columns int

The number of columns.

htmlAttributes IDictionary<string, object>

An object that contains the HTML attributes to set for the element.

Returns

MvcHtmlString

The textarea element.

TextArea(HtmlHelper, string, string, int, int, 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.

public static MvcHtmlString TextArea(this HtmlHelper htmlHelper, string name, string value, int rows, int columns, object htmlAttributes)

Parameters

htmlHelper HtmlHelper

The HTML helper instance that this method extends.

name string

The name of the form field to return.

value string

The text content.

rows int

The number of rows.

columns int

The number of columns.

htmlAttributes object

An object that contains the HTML attributes to set for the element.

Returns

MvcHtmlString

The textarea element.

TextArea(HtmlHelper, string, string, object)

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

public static MvcHtmlString TextArea(this HtmlHelper htmlHelper, string name, string value, object htmlAttributes)

Parameters

htmlHelper HtmlHelper

The HTML helper instance that this method extends.

name string

The name of the form field to return.

value string

The text content.

htmlAttributes object

An object that contains the HTML attributes to set for the element.

Returns

MvcHtmlString

The textarea element.

TextAreaFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>)

Returns an HTML textarea element for each property in the object that is represented by the specified expression.

public static MvcHtmlString TextAreaFor<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression)

Parameters

htmlHelper HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression Expression<Func<TModel, TProperty>>

An expression that identifies the object that contains the properties to render.

Returns

MvcHtmlString

An HTML textarea element for each property in the object that is represented by the expression.

Type Parameters

TModel

The type of the model.

TProperty

The type of the property.

Exceptions

ArgumentNullException

The expression parameter is null.

TextAreaFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, IDictionary<string, object>)

Returns an HTML textarea element for each property in the object that is represented by the specified expression using the specified HTML attributes.

public static MvcHtmlString TextAreaFor<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression, IDictionary<string, object> htmlAttributes)

Parameters

htmlHelper HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression Expression<Func<TModel, TProperty>>

An expression that identifies the object that contains the properties to render.

htmlAttributes IDictionary<string, object>

A dictionary that contains the HTML attributes to set for the element.

Returns

MvcHtmlString

An HTML textarea element for each property in the object that is represented by the expression.

Type Parameters

TModel

The type of the model.

TProperty

The type of the property.

Exceptions

ArgumentNullException

The expression parameter is null.

TextAreaFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, int, int, IDictionary<string, object>)

Returns an HTML textarea element for each property in the object that is represented by the specified expression using the specified HTML attributes and the number of rows and columns.

public static MvcHtmlString TextAreaFor<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression, int rows, int columns, IDictionary<string, object> htmlAttributes)

Parameters

htmlHelper HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression Expression<Func<TModel, TProperty>>

An expression that identifies the object that contains the properties to render.

rows int

The number of rows.

columns int

The number of columns.

htmlAttributes IDictionary<string, object>

A dictionary that contains the HTML attributes to set for the element.

Returns

MvcHtmlString

An HTML textarea element for each property in the object that is represented by the expression.

Type Parameters

TModel

The type of the model.

TProperty

The type of the property.

Exceptions

ArgumentNullException

The expression parameter is null.

TextAreaFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, int, int, object)

Returns an HTML textarea element for each property in the object that is represented by the specified expression using the specified HTML attributes and the number of rows and columns.

public static MvcHtmlString TextAreaFor<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression, int rows, int columns, object htmlAttributes)

Parameters

htmlHelper HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression Expression<Func<TModel, TProperty>>

An expression that identifies the object that contains the properties to render.

rows int

The number of rows.

columns int

The number of columns.

htmlAttributes object

A dictionary that contains the HTML attributes to set for the element.

Returns

MvcHtmlString

An HTML textarea element for each property in the object that is represented by the expression.

Type Parameters

TModel

The type of the model.

TProperty

The type of the property.

Exceptions

ArgumentNullException

The expression parameter is null.

TextAreaFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, object)

Returns an HTML textarea element for each property in the object that is represented by the specified expression using the specified HTML attributes.

public static MvcHtmlString TextAreaFor<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression, object htmlAttributes)

Parameters

htmlHelper HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression Expression<Func<TModel, TProperty>>

An expression that identifies the object that contains the properties to render.

htmlAttributes object

A dictionary that contains the HTML attributes to set for the element.

Returns

MvcHtmlString

An HTML textarea element for each property in the object that is represented by the expression.

Type Parameters

TModel

The type of the model.

TProperty

The type of the property.

Exceptions

ArgumentNullException

The expression parameter is null.