Share via


HtmlHelperInputExtensions.TextAreaFor Method

Definition

Overloads

TextAreaFor<TModel,TResult>(IHtmlHelper<TModel>, Expression<Func<TModel,TResult>>)

Returns a <textarea> element for the specified expression. Adds content to the element body based on the first non-null value found in: the ModelState entry with full name, or the expression evaluated against Model. See NameFor<TResult>(Expression<Func<TModel,TResult>>) for more information about a "full name".

TextAreaFor<TModel,TResult>(IHtmlHelper<TModel>, Expression<Func<TModel,TResult>>, Object)

Returns a <textarea> element for the specified expression. Adds content to the element body based on the first non-null value found in: the ModelState entry with full name, or the expression evaluated against Model. See NameFor<TResult>(Expression<Func<TModel,TResult>>) for more information about a "full name".

TextAreaFor<TModel,TResult>(IHtmlHelper<TModel>, Expression<Func<TModel,TResult>>)

Source:
HtmlHelperInputExtensions.cs
Source:
HtmlHelperInputExtensions.cs
Source:
HtmlHelperInputExtensions.cs

Returns a <textarea> element for the specified expression. Adds content to the element body based on the first non-null value found in: the ModelState entry with full name, or the expression evaluated against Model. See NameFor<TResult>(Expression<Func<TModel,TResult>>) for more information about a "full name".

public:
generic <typename TModel, typename TResult>
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Html::IHtmlContent ^ TextAreaFor(Microsoft::AspNetCore::Mvc::Rendering::IHtmlHelper<TModel> ^ htmlHelper, System::Linq::Expressions::Expression<Func<TModel, TResult> ^> ^ expression);
public static Microsoft.AspNetCore.Html.IHtmlContent TextAreaFor<TModel,TResult> (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<TModel> htmlHelper, System.Linq.Expressions.Expression<Func<TModel,TResult>> expression);
static member TextAreaFor : Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Result>> -> Microsoft.AspNetCore.Html.IHtmlContent
<Extension()>
Public Function TextAreaFor(Of TModel, TResult) (htmlHelper As IHtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TResult))) As IHtmlContent

Type Parameters

TModel

The type of the model.

TResult

The type of the expression result.

Parameters

htmlHelper
IHtmlHelper<TModel>

The IHtmlHelper<TModel> instance this method extends.

expression
Expression<Func<TModel,TResult>>

An expression to be evaluated against the current model.

Returns

A new IHtmlContent containing the <textarea> element.

Remarks

Combines HtmlFieldPrefix and the string representation of the expression to set <textarea> element's "name" attribute. Sanitizes the string representation of the expression to set element's "id" attribute.

Applies to

TextAreaFor<TModel,TResult>(IHtmlHelper<TModel>, Expression<Func<TModel,TResult>>, Object)

Source:
HtmlHelperInputExtensions.cs
Source:
HtmlHelperInputExtensions.cs
Source:
HtmlHelperInputExtensions.cs

Returns a <textarea> element for the specified expression. Adds content to the element body based on the first non-null value found in: the ModelState entry with full name, or the expression evaluated against Model. See NameFor<TResult>(Expression<Func<TModel,TResult>>) for more information about a "full name".

public:
generic <typename TModel, typename TResult>
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Html::IHtmlContent ^ TextAreaFor(Microsoft::AspNetCore::Mvc::Rendering::IHtmlHelper<TModel> ^ htmlHelper, System::Linq::Expressions::Expression<Func<TModel, TResult> ^> ^ expression, System::Object ^ htmlAttributes);
public static Microsoft.AspNetCore.Html.IHtmlContent TextAreaFor<TModel,TResult> (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<TModel> htmlHelper, System.Linq.Expressions.Expression<Func<TModel,TResult>> expression, object htmlAttributes);
static member TextAreaFor : Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Result>> * obj -> Microsoft.AspNetCore.Html.IHtmlContent
<Extension()>
Public Function TextAreaFor(Of TModel, TResult) (htmlHelper As IHtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TResult)), htmlAttributes As Object) As IHtmlContent

Type Parameters

TModel

The type of the model.

TResult

The type of the expression result.

Parameters

htmlHelper
IHtmlHelper<TModel>

The IHtmlHelper<TModel> instance this method extends.

expression
Expression<Func<TModel,TResult>>

An expression to be evaluated against the current model.

htmlAttributes
Object

An Object that contains the HTML attributes for the element. Alternatively, an IDictionary<TKey,TValue> instance containing the HTML attributes.

Returns

A new IHtmlContent containing the <textarea> element.

Remarks

Combines HtmlFieldPrefix and the string representation of the expression to set <textarea> element's "name" attribute. Sanitizes the string representation of the expression to set element's "id" attribute.

Applies to