HtmlHelper.GenerateDropDown 方法

定义

生成下拉列表。

protected:
 Microsoft::AspNetCore::Html::IHtmlContent ^ GenerateDropDown(Microsoft::AspNetCore::Mvc::ViewFeatures::ModelExplorer ^ modelExplorer, System::String ^ expression, System::Collections::Generic::IEnumerable<Microsoft::AspNetCore::Mvc::Rendering::SelectListItem ^> ^ selectList, System::String ^ optionLabel, System::Object ^ htmlAttributes);
protected Microsoft.AspNetCore.Html.IHtmlContent GenerateDropDown (Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer modelExplorer, string expression, System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Mvc.Rendering.SelectListItem> selectList, string optionLabel, object htmlAttributes);
member this.GenerateDropDown : Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer * string * seq<Microsoft.AspNetCore.Mvc.Rendering.SelectListItem> * string * obj -> Microsoft.AspNetCore.Html.IHtmlContent
Protected Function GenerateDropDown (modelExplorer As ModelExplorer, expression As String, selectList As IEnumerable(Of SelectListItem), optionLabel As String, htmlAttributes As Object) As IHtmlContent

参数

modelExplorer
ModelExplorer

ModelExplorer

expression
String

表达式。

selectList
IEnumerable<SelectListItem>

选择列表。

optionLabel
String

选项标签。

htmlAttributes
Object

一个 Object ,其中包含元素的 HTML 属性。 或者,一个 IDictionary<TKey,TValue> 包含 HTML 属性的 实例。

返回

IHtmlContent

适用于