Table of Contents

Class DisplayExtensions

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

Represents support for rendering object values as HTML.

public static class DisplayExtensions
Inheritance
DisplayExtensions
Inherited Members

Methods

Display(HtmlHelper, string)

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

public static MvcHtmlString Display(this HtmlHelper html, string expression)

Parameters

html HtmlHelper

The HTML helper instance that this method extends.

expression string

An 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.

Display(HtmlHelper, string, object)

Returns HTML markup for each property in the object that is represented by a string expression, using additional view data.

public static MvcHtmlString Display(this HtmlHelper html, string expression, object additionalViewData)

Parameters

html HtmlHelper

The HTML helper instance that this method extends.

expression string

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

additionalViewData object

An anonymous object that can contain additional view data that will be merged into the ViewDataDictionary<TModel> instance that is created for the template.

Returns

MvcHtmlString

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

Display(HtmlHelper, string, string)

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

public static MvcHtmlString Display(this HtmlHelper html, string expression, string templateName)

Parameters

html HtmlHelper

The HTML helper instance that this method extends.

expression string

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

templateName string

The name of the template that is used to render the object.

Returns

MvcHtmlString

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

Display(HtmlHelper, string, string, object)

Returns HTML markup for each property in the object that is represented by the expression, using the specified template and additional view data.

public static MvcHtmlString Display(this HtmlHelper html, string expression, string templateName, object additionalViewData)

Parameters

html HtmlHelper

The HTML helper instance that this method extends.

expression string

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

templateName string

The name of the template that is used to render the object.

additionalViewData object

An anonymous object that can contain additional view data that will be merged into the ViewDataDictionary<TModel> instance that is created for the template.

Returns

MvcHtmlString

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

Display(HtmlHelper, string, string, string)

Returns HTML markup for each property in the object that is represented by the expression, using the specified template and an HTML field ID.

public static MvcHtmlString Display(this HtmlHelper html, string expression, string templateName, string htmlFieldName)

Parameters

html HtmlHelper

The HTML helper instance that this method extends.

expression string

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

templateName string

The name of the template that is used to render the object.

htmlFieldName string

A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name.

Returns

MvcHtmlString

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

Display(HtmlHelper, string, string, string, object)

Returns HTML markup for each property in the object that is represented by the expression, using the specified template, HTML field ID, and additional view data.

public static MvcHtmlString Display(this HtmlHelper html, string expression, string templateName, string htmlFieldName, object additionalViewData)

Parameters

html HtmlHelper

The HTML helper instance that this method extends.

expression string

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

templateName string

The name of the template that is used to render the object.

htmlFieldName string

A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name.

additionalViewData object

An anonymous object that can contain additional view data that will be merged into the ViewDataDictionary<TModel> instance that is created for the template.

Returns

MvcHtmlString

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

DisplayForModel(HtmlHelper)

Returns HTML markup for each property in the model.

public static MvcHtmlString DisplayForModel(this HtmlHelper html)

Parameters

html HtmlHelper

The HTML helper instance that this method extends.

Returns

MvcHtmlString

The HTML markup for each property in the model.

DisplayForModel(HtmlHelper, object)

Returns HTML markup for each property in the model, using additional view data.

public static MvcHtmlString DisplayForModel(this HtmlHelper html, object additionalViewData)

Parameters

html HtmlHelper

The HTML helper instance that this method extends.

additionalViewData object

An anonymous object that can contain additional view data that will be merged into the ViewDataDictionary<TModel> instance that is created for the template.

Returns

MvcHtmlString

The HTML markup for each property in the model.

DisplayForModel(HtmlHelper, string)

Returns HTML markup for each property in the model using the specified template.

public static MvcHtmlString DisplayForModel(this HtmlHelper html, string templateName)

Parameters

html HtmlHelper

The HTML helper instance that this method extends.

templateName string

The name of the template that is used to render the object.

Returns

MvcHtmlString

The HTML markup for each property in the model.

DisplayForModel(HtmlHelper, string, object)

Returns HTML markup for each property in the model, using the specified template and additional view data.

public static MvcHtmlString DisplayForModel(this HtmlHelper html, string templateName, object additionalViewData)

Parameters

html HtmlHelper

The HTML helper instance that this method extends.

templateName string

The name of the template that is used to render the object.

additionalViewData object

An anonymous object that can contain additional view data that will be merged into the ViewDataDictionary<TModel> instance that is created for the template.

Returns

MvcHtmlString

The HTML markup for each property in the model.

DisplayForModel(HtmlHelper, string, string)

Returns HTML markup for each property in the model using the specified template and HTML field ID.

public static MvcHtmlString DisplayForModel(this HtmlHelper html, string templateName, string htmlFieldName)

Parameters

html HtmlHelper

The HTML helper instance that this method extends.

templateName string

The name of the template that is used to render the object.

htmlFieldName string

A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name.

Returns

MvcHtmlString

The HTML markup for each property in the model.

DisplayForModel(HtmlHelper, string, string, object)

Returns HTML markup for each property in the model, using the specified template, an HTML field ID, and additional view data.

public static MvcHtmlString DisplayForModel(this HtmlHelper html, string templateName, string htmlFieldName, object additionalViewData)

Parameters

html HtmlHelper

The HTML helper instance that this method extends.

templateName string

The name of the template that is used to render the object.

htmlFieldName string

A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name.

additionalViewData object

An anonymous object that can contain additional view data that will be merged into the ViewDataDictionary<TModel> instance that is created for the template.

Returns

MvcHtmlString

The HTML markup for each property in the model.

DisplayFor<TModel, TValue>(HtmlHelper<TModel>, Expression<Func<TModel, TValue>>)

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

public static MvcHtmlString DisplayFor<TModel, TValue>(this HtmlHelper<TModel> html, Expression<Func<TModel, TValue>> expression)

Parameters

html HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression Expression<Func<TModel, TValue>>

An 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.

Type Parameters

TModel

The type of the model.

TValue

The type of the value.

DisplayFor<TModel, TValue>(HtmlHelper<TModel>, Expression<Func<TModel, TValue>>, object)

Returns a string that contains each property value in the object that is represented by the specified expression, using additional view data.

public static MvcHtmlString DisplayFor<TModel, TValue>(this HtmlHelper<TModel> html, Expression<Func<TModel, TValue>> expression, object additionalViewData)

Parameters

html HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression Expression<Func<TModel, TValue>>

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

additionalViewData object

An anonymous object that can contain additional view data that will be merged into the ViewDataDictionary<TModel> instance that is created for the template.

Returns

MvcHtmlString

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

Type Parameters

TModel

The type of the model.

TValue

The type of the value.

DisplayFor<TModel, TValue>(HtmlHelper<TModel>, Expression<Func<TModel, TValue>>, string)

Returns a string that contains each property value in the object that is represented by the Expression, using the specified template.

public static MvcHtmlString DisplayFor<TModel, TValue>(this HtmlHelper<TModel> html, Expression<Func<TModel, TValue>> expression, string templateName)

Parameters

html HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression Expression<Func<TModel, TValue>>

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

templateName string

The name of the template that is used to render the object.

Returns

MvcHtmlString

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

Type Parameters

TModel

The type of the model.

TValue

The type of the value.

DisplayFor<TModel, TValue>(HtmlHelper<TModel>, Expression<Func<TModel, TValue>>, string, object)

Returns a string that contains each property value in the object that is represented by the specified expression, using the specified template and additional view data.

public static MvcHtmlString DisplayFor<TModel, TValue>(this HtmlHelper<TModel> html, Expression<Func<TModel, TValue>> expression, string templateName, object additionalViewData)

Parameters

html HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression Expression<Func<TModel, TValue>>

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

templateName string

The name of the template that is used to render the object.

additionalViewData object

An anonymous object that can contain additional view data that will be merged into the ViewDataDictionary<TModel> instance that is created for the template.

Returns

MvcHtmlString

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

Type Parameters

TModel

The type of the model.

TValue

The type of the value.

DisplayFor<TModel, TValue>(HtmlHelper<TModel>, Expression<Func<TModel, TValue>>, string, string)

Returns HTML markup for each property in the object that is represented by the Expression, using the specified template and an HTML field ID.

public static MvcHtmlString DisplayFor<TModel, TValue>(this HtmlHelper<TModel> html, Expression<Func<TModel, TValue>> expression, string templateName, string htmlFieldName)

Parameters

html HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression Expression<Func<TModel, TValue>>

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

templateName string

The name of the template that is used to render the object.

htmlFieldName string

A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name.

Returns

MvcHtmlString

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

Type Parameters

TModel

The type of the model.

TValue

The type of the value.

DisplayFor<TModel, TValue>(HtmlHelper<TModel>, Expression<Func<TModel, TValue>>, string, string, object)

Returns HTML markup for each property in the object that is represented by the specified expression, using the template, an HTML field ID, and additional view data.

public static MvcHtmlString DisplayFor<TModel, TValue>(this HtmlHelper<TModel> html, Expression<Func<TModel, TValue>> expression, string templateName, string htmlFieldName, object additionalViewData)

Parameters

html HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression Expression<Func<TModel, TValue>>

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

templateName string

The name of the template that is used to render the object.

htmlFieldName string

A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name.

additionalViewData object

An anonymous object that can contain additional view data that will be merged into the ViewDataDictionary<TModel> instance that is created for the template.

Returns

MvcHtmlString

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

Type Parameters

TModel

The type of the model.

TValue

The type of the value.