IHtmlGenerator.GenerateGroupsAndOptions Method

Definition

Generates <optgroup> and <option> elements.

C#
public Microsoft.AspNetCore.Html.IHtmlContent GenerateGroupsAndOptions (string optionLabel, System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Mvc.Rendering.SelectListItem> selectList);

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.

Applies to

منتج الإصدارات
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0