Delen via


DefaultHtmlGenerator.GenerateGroupsAndOptions Method

Definition

Generates <optgroup> and <option> elements.

public:
 virtual 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
override this.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

Parameters

optionLabel
String

Optional text for a default empty <option> element.

selectList
IEnumerable<SelectListItem>

A collection of SelectListItem objects used to generate <optgroup> and <option> elements.

Returns

An IHtmlContent instance for <optgroup> and <option> elements.

Implements

Applies to