Share via


IHtmlGenerator.GenerateGroupsAndOptions 方法

定义

生成 <optgroup> 和 <option> 元素。

public:
 Microsoft::AspNetCore::Html::IHtmlContent ^ GenerateGroupsAndOptions(System::String ^ optionLabel, System::Collections::Generic::IEnumerable<Microsoft::AspNetCore::Mvc::Rendering::SelectListItem ^> ^ selectList);
public Microsoft.AspNetCore.Html.IHtmlContent GenerateGroupsAndOptions (string optionLabel, System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Mvc.Rendering.SelectListItem> selectList);
abstract member GenerateGroupsAndOptions : string * seq<Microsoft.AspNetCore.Mvc.Rendering.SelectListItem> -> Microsoft.AspNetCore.Html.IHtmlContent
Public Function GenerateGroupsAndOptions (optionLabel As String, selectList As IEnumerable(Of SelectListItem)) As IHtmlContent

参数

optionLabel
String

默认空 <选项> 元素的可选文本。

selectList
IEnumerable<SelectListItem>

用于生成 <optgroup> 和 <option> 元素的 对象的集合SelectListItem

返回

IHtmlContent optgroup> 和 <option> 元素的<实例。

适用于