Class DisplayTextExtensions
Provides a way to render object values as HTML.
public static class DisplayTextExtensions
- Inheritance
-
DisplayTextExtensions
- Inherited Members
Methods
DisplayText(HtmlHelper, string)
Returns HTML markup for each property in the object that is represented by the specified expression.
public static MvcHtmlString DisplayText(this HtmlHelper html, string name)
Parameters
html
HtmlHelperThe HTML helper instance that this method extends.
name
stringAn expression that identifies the object that contains the properties to display.
Returns
- MvcHtmlString
The HTML markup for each property in the object that is represented by the expression.
DisplayTextFor<TModel, TResult>(HtmlHelper<TModel>, Expression<Func<TModel, TResult>>)
Returns HTML markup for each property in the object that is represented by the specified expression.
public static MvcHtmlString DisplayTextFor<TModel, TResult>(this HtmlHelper<TModel> html, Expression<Func<TModel, TResult>> expression)
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
- MvcHtmlString
The HTML markup for each property.
Type Parameters
TModel
The type of the model.
TResult
The type of the result.