SelectExtensions.DropDownListFor 方法

定義

多載

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

使用指定的清單專案、選項標籤和 HTML 屬性,傳回 物件中每個屬性的 HTML 選取專案。

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

使用指定的清單專案和選項標籤,傳回 物件中每個屬性的 HTML 選取專案。

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

使用指定的清單專案、選項標籤和 HTML 屬性,傳回 物件中每個屬性的 HTML 選取專案。

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

使用指定的清單專案和 HTML 屬性,傳回 物件中每個屬性的 HTML 選取專案。

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

傳回物件中每個屬性的 HTML 選取專案,該物件使用指定的清單專案由指定的運算式表示。

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

使用指定的清單專案和 HTML 屬性,傳回 物件中每個屬性的 HTML 選取專案。

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

使用指定的清單專案、選項標籤和 HTML 屬性,傳回 物件中每個屬性的 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 Helper 執行個體。

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 選取專案。

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 Helper 執行個體。

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 屬性,傳回 物件中每個屬性的 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 Helper 執行個體。

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 屬性,傳回 物件中每個屬性的 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 Helper 執行個體。

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 選取專案,該物件使用指定的清單專案由指定的運算式表示。

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 Helper 執行個體。

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 屬性,傳回 物件中每個屬性的 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 Helper 執行個體。

expression
Expression<Func<TModel,TProperty>>

運算式,可識別包含要顯示之屬性的物件。

selectList
IEnumerable<SelectListItem>

物件集合 SelectListItem ,用來填入下拉式清單。

htmlAttributes
Object

物件,包含要針對項目設定的 HTML 屬性。

傳回

運算式所表示之物件中每一個屬性的 HTML select 項目。

例外狀況

expression 參數為 null。

適用於