SelectExtensions.DropDownListFor 方法

定义

重载

DropDownListFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, IEnumerable<SelectListItem>, String, IDictionary<String, Object>)

返回对象中每个属性的 HTML select 元素,该属性由指定的表达式使用指定的列表项、选项标签和 HTML 属性表示。

DropDownListFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, IEnumerable<SelectListItem>, String)

返回对象中每个属性的 HTML select 元素,该属性由使用指定的列表项和选项标签的指定表达式表示。

DropDownListFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, IEnumerable<SelectListItem>, String, Object)

返回对象中每个属性的 HTML select 元素,该属性由指定的表达式使用指定的列表项、选项标签和 HTML 属性表示。

DropDownListFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, IEnumerable<SelectListItem>, IDictionary<String,Object>)

返回对象中每个属性的 HTML select 元素,该属性由使用指定的列表项和 HTML 属性的指定表达式表示。

DropDownListFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, IEnumerable<SelectListItem>)

返回对象中每个属性的 HTML select 元素,该属性由使用指定的列表项的指定表达式表示。

DropDownListFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, IEnumerable<SelectListItem>, Object)

返回对象中每个属性的 HTML select 元素,该属性由使用指定的列表项和 HTML 属性的指定表达式表示。

DropDownListFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, IEnumerable<SelectListItem>, String, IDictionary<String, Object>)

返回对象中每个属性的 HTML select 元素,该属性由指定的表达式使用指定的列表项、选项标签和 HTML 属性表示。

public static System.Web.Mvc.MvcHtmlString DropDownListFor<TModel,TProperty> (this System.Web.Mvc.HtmlHelper<TModel> htmlHelper, System.Linq.Expressions.Expression<Func<TModel,TProperty>> expression, System.Collections.Generic.IEnumerable<System.Web.Mvc.SelectListItem> selectList, string optionLabel, System.Collections.Generic.IDictionary<string,object> htmlAttributes);
static member DropDownListFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Property>> * seq<System.Web.Mvc.SelectListItem> * string * System.Collections.Generic.IDictionary<string, obj> -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function DropDownListFor(Of TModel, TProperty) (htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TProperty)), selectList As IEnumerable(Of SelectListItem), optionLabel As String, htmlAttributes As IDictionary(Of String, Object)) As MvcHtmlString

类型参数

TModel

模型的类型。

TProperty

值的类型。

参数

htmlHelper
HtmlHelper<TModel>

此方法扩展的 HTML 帮助器实例。

expression
Expression<Func<TModel,TProperty>>

一个表达式,用于标识包含要显示的属性的对象。

selectList
IEnumerable<SelectListItem>

用于填充下拉列表的 对象的集合 SelectListItem

optionLabel
String

默认空项的文本。 此参数可以为 null。

htmlAttributes
IDictionary<String,Object>

一个 对象,其中包含要为 元素设置的 HTML 属性。

返回

一个由表达式表示的对象中的每个属性所对应的 HTML select 元素。

例外

expression 参数为 null。

适用于

DropDownListFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, IEnumerable<SelectListItem>, String)

返回对象中每个属性的 HTML select 元素,该属性由使用指定的列表项和选项标签的指定表达式表示。

public static System.Web.Mvc.MvcHtmlString DropDownListFor<TModel,TProperty> (this System.Web.Mvc.HtmlHelper<TModel> htmlHelper, System.Linq.Expressions.Expression<Func<TModel,TProperty>> expression, System.Collections.Generic.IEnumerable<System.Web.Mvc.SelectListItem> selectList, string optionLabel);
static member DropDownListFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Property>> * seq<System.Web.Mvc.SelectListItem> * string -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function DropDownListFor(Of TModel, TProperty) (htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TProperty)), selectList As IEnumerable(Of SelectListItem), optionLabel As String) As MvcHtmlString

类型参数

TModel

模型的类型。

TProperty

值的类型。

参数

htmlHelper
HtmlHelper<TModel>

此方法扩展的 HTML 帮助器实例。

expression
Expression<Func<TModel,TProperty>>

一个表达式,用于标识包含要显示的属性的对象。

selectList
IEnumerable<SelectListItem>

用于填充下拉列表的 对象的集合 SelectListItem

optionLabel
String

默认空项的文本。 此参数可以为 null。

返回

一个由表达式表示的对象中的每个属性所对应的 HTML select 元素。

例外

expression 参数为 null。

适用于

DropDownListFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, IEnumerable<SelectListItem>, String, Object)

返回对象中每个属性的 HTML select 元素,该属性由指定的表达式使用指定的列表项、选项标签和 HTML 属性表示。

public static System.Web.Mvc.MvcHtmlString DropDownListFor<TModel,TProperty> (this System.Web.Mvc.HtmlHelper<TModel> htmlHelper, System.Linq.Expressions.Expression<Func<TModel,TProperty>> expression, System.Collections.Generic.IEnumerable<System.Web.Mvc.SelectListItem> selectList, string optionLabel, object htmlAttributes);
static member DropDownListFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Property>> * seq<System.Web.Mvc.SelectListItem> * string * obj -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function DropDownListFor(Of TModel, TProperty) (htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TProperty)), selectList As IEnumerable(Of SelectListItem), optionLabel As String, htmlAttributes As Object) As MvcHtmlString

类型参数

TModel

模型的类型。

TProperty

值的类型。

参数

htmlHelper
HtmlHelper<TModel>

此方法扩展的 HTML 帮助器实例。

expression
Expression<Func<TModel,TProperty>>

一个表达式,用于标识包含要显示的属性的对象。

selectList
IEnumerable<SelectListItem>

用于填充下拉列表的 对象的集合 SelectListItem

optionLabel
String

默认空项的文本。 此参数可以为 null。

htmlAttributes
Object

一个 对象,其中包含要为 元素设置的 HTML 属性。

返回

一个由表达式表示的对象中的每个属性所对应的 HTML select 元素。

例外

expression 参数为 null。

适用于

DropDownListFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, IEnumerable<SelectListItem>, IDictionary<String,Object>)

返回对象中每个属性的 HTML select 元素,该属性由使用指定的列表项和 HTML 属性的指定表达式表示。

public static System.Web.Mvc.MvcHtmlString DropDownListFor<TModel,TProperty> (this System.Web.Mvc.HtmlHelper<TModel> htmlHelper, System.Linq.Expressions.Expression<Func<TModel,TProperty>> expression, System.Collections.Generic.IEnumerable<System.Web.Mvc.SelectListItem> selectList, System.Collections.Generic.IDictionary<string,object> htmlAttributes);
static member DropDownListFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Property>> * seq<System.Web.Mvc.SelectListItem> * System.Collections.Generic.IDictionary<string, obj> -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function DropDownListFor(Of TModel, TProperty) (htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TProperty)), selectList As IEnumerable(Of SelectListItem), htmlAttributes As IDictionary(Of String, Object)) As MvcHtmlString

类型参数

TModel

模型的类型。

TProperty

值的类型。

参数

htmlHelper
HtmlHelper<TModel>

此方法扩展的 HTML 帮助器实例。

expression
Expression<Func<TModel,TProperty>>

一个表达式,用于标识包含要显示的属性的对象。

selectList
IEnumerable<SelectListItem>

用于填充下拉列表的 对象的集合 SelectListItem

htmlAttributes
IDictionary<String,Object>

一个 对象,其中包含要为 元素设置的 HTML 属性。

返回

一个由表达式表示的对象中的每个属性所对应的 HTML select 元素。

例外

expression 参数为 null。

适用于

DropDownListFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, IEnumerable<SelectListItem>)

返回对象中每个属性的 HTML select 元素,该属性由使用指定的列表项的指定表达式表示。

public static System.Web.Mvc.MvcHtmlString DropDownListFor<TModel,TProperty> (this System.Web.Mvc.HtmlHelper<TModel> htmlHelper, System.Linq.Expressions.Expression<Func<TModel,TProperty>> expression, System.Collections.Generic.IEnumerable<System.Web.Mvc.SelectListItem> selectList);
static member DropDownListFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Property>> * seq<System.Web.Mvc.SelectListItem> -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function DropDownListFor(Of TModel, TProperty) (htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TProperty)), selectList As IEnumerable(Of SelectListItem)) As MvcHtmlString

类型参数

TModel

模型的类型。

TProperty

值的类型。

参数

htmlHelper
HtmlHelper<TModel>

此方法扩展的 HTML 帮助器实例。

expression
Expression<Func<TModel,TProperty>>

一个表达式,用于标识包含要显示的属性的对象。

selectList
IEnumerable<SelectListItem>

用于填充下拉列表的 对象的集合 SelectListItem

返回

一个由表达式表示的对象中的每个属性所对应的 HTML select 元素。

例外

expression 参数为 null。

适用于

DropDownListFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, IEnumerable<SelectListItem>, Object)

返回对象中每个属性的 HTML select 元素,该属性由使用指定的列表项和 HTML 属性的指定表达式表示。

public static System.Web.Mvc.MvcHtmlString DropDownListFor<TModel,TProperty> (this System.Web.Mvc.HtmlHelper<TModel> htmlHelper, System.Linq.Expressions.Expression<Func<TModel,TProperty>> expression, System.Collections.Generic.IEnumerable<System.Web.Mvc.SelectListItem> selectList, object htmlAttributes);
static member DropDownListFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Property>> * seq<System.Web.Mvc.SelectListItem> * obj -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function DropDownListFor(Of TModel, TProperty) (htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TProperty)), selectList As IEnumerable(Of SelectListItem), htmlAttributes As Object) As MvcHtmlString

类型参数

TModel

模型的类型。

TProperty

值的类型。

参数

htmlHelper
HtmlHelper<TModel>

此方法扩展的 HTML 帮助器实例。

expression
Expression<Func<TModel,TProperty>>

一个表达式,用于标识包含要显示的属性的对象。

selectList
IEnumerable<SelectListItem>

用于填充下拉列表的 对象的集合 SelectListItem

htmlAttributes
Object

一个 对象,其中包含要为 元素设置的 HTML 属性。

返回

一个由表达式表示的对象中的每个属性所对应的 HTML select 元素。

例外

expression 参数为 null。

适用于