DisplayTextExtensions.DisplayTextFor<TModel,TResult> Method

Definition

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

C#
public static System.Web.Mvc.MvcHtmlString DisplayTextFor<TModel,TResult> (this System.Web.Mvc.HtmlHelper<TModel> html, System.Linq.Expressions.Expression<Func<TModel,TResult>> expression);

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

Product Versions
ASP.NET MVC 5.2