Share via


DisplayTextExtensions.DisplayTextFor<TModel,TResult> Method

Definition

Returns HTML markup for each property in the object that is represented by the specified expression.

public static System.Web.Mvc.MvcHtmlString DisplayTextFor<TModel,TResult> (this System.Web.Mvc.HtmlHelper<TModel> html, System.Linq.Expressions.Expression<Func<TModel,TResult>> expression);
static member DisplayTextFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Result>> -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function DisplayTextFor(Of TModel, TResult) (html As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TResult))) As MvcHtmlString

Type Parameters

TModel

The type of the model.

TResult

The type of the result.

Parameters

html
HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression
Expression<Func<TModel,TResult>>

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

Returns

The HTML markup for each property.

Applies to