傳回指定運算式所表示之列舉中每一個值的 HTML select 元素。
public static System.Web.Mvc.MvcHtmlString EnumDropDownListFor (this System.Web.Mvc.HtmlHelper htmlHelper, System.Linq.Expressions.Expression> expression, string optionLabel, System.Collections.Generic.IDictionary htmlAttributes);
static member EnumDropDownListFor : System.Web.Mvc.HtmlHelper * System.Linq.Expressions.Expression> * string * System.Collections.Generic.IDictionary -> System.Web.Mvc.MvcHtmlString
Public Function EnumDropDownListFor(Of TModel, TEnum) (htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TEnum)), optionLabel As String, htmlAttributes As IDictionary(Of String, Object)) As MvcHtmlString
類型參數
TModel
模型的型別。
TEnum
值的類型。
參數
此方法擴充的 HTML Helper 執行個體。
expression
Expression>
運算式,可識別包含要顯示之值的物件。
optionLabel
預設空白項目的文字。 此參數可以是 null。
物件,包含要針對項目設定的 HTML 屬性。
傳回
運算式所表示之列舉中每一個值的 HTML select 元素。
適用於