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>

物件集合 SelectListItem ,用來產生 < optgroup > 和 < option > 元素。

傳回

IHtmlContentoptgroup > 和 < option > 元素的 < 實例。

適用於