Delen via


DisplayExtensions.DisplayFor Method

Definition

Overloads

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.

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.

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.

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.

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.

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.

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 System.Web.Mvc.MvcHtmlString DisplayFor<TModel,TValue> (this System.Web.Mvc.HtmlHelper<TModel> html, System.Linq.Expressions.Expression<Func<TModel,TValue>> expression, string templateName, string htmlFieldName, object additionalViewData);
static member DisplayFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Value>> * string * string * obj -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function DisplayFor(Of TModel, TValue) (html As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TValue)), templateName As String, htmlFieldName As String, additionalViewData As Object) As MvcHtmlString

Type Parameters

TModel

The type of the model.

TValue

The type of the value.

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

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

Applies to

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 System.Web.Mvc.MvcHtmlString DisplayFor<TModel,TValue> (this System.Web.Mvc.HtmlHelper<TModel> html, System.Linq.Expressions.Expression<Func<TModel,TValue>> expression, string templateName, string htmlFieldName);
static member DisplayFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Value>> * string * string -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function DisplayFor(Of TModel, TValue) (html As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TValue)), templateName As String, htmlFieldName As String) As MvcHtmlString

Type Parameters

TModel

The type of the model.

TValue

The type of the value.

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

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

Applies to

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 System.Web.Mvc.MvcHtmlString DisplayFor<TModel,TValue> (this System.Web.Mvc.HtmlHelper<TModel> html, System.Linq.Expressions.Expression<Func<TModel,TValue>> expression, string templateName, object additionalViewData);
static member DisplayFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Value>> * string * obj -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function DisplayFor(Of TModel, TValue) (html As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TValue)), templateName As String, additionalViewData As Object) As MvcHtmlString

Type Parameters

TModel

The type of the model.

TValue

The type of the value.

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

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

Applies to

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 System.Web.Mvc.MvcHtmlString DisplayFor<TModel,TValue> (this System.Web.Mvc.HtmlHelper<TModel> html, System.Linq.Expressions.Expression<Func<TModel,TValue>> expression, string templateName);
static member DisplayFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Value>> * string -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function DisplayFor(Of TModel, TValue) (html As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TValue)), templateName As String) As MvcHtmlString

Type Parameters

TModel

The type of the model.

TValue

The type of the value.

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

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

Applies to

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 System.Web.Mvc.MvcHtmlString DisplayFor<TModel,TValue> (this System.Web.Mvc.HtmlHelper<TModel> html, System.Linq.Expressions.Expression<Func<TModel,TValue>> expression, object additionalViewData);
static member DisplayFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Value>> * obj -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function DisplayFor(Of TModel, TValue) (html As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TValue)), additionalViewData As Object) As MvcHtmlString

Type Parameters

TModel

The type of the model.

TValue

The type of the value.

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

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

Applies to

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 System.Web.Mvc.MvcHtmlString DisplayFor<TModel,TValue> (this System.Web.Mvc.HtmlHelper<TModel> html, System.Linq.Expressions.Expression<Func<TModel,TValue>> expression);
static member DisplayFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Value>> -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function DisplayFor(Of TModel, TValue) (html As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TValue))) As MvcHtmlString

Type Parameters

TModel

The type of the model.

TValue

The type of the value.

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

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

Applies to