Bagikan melalui


DefaultHtmlGenerator.GenerateSelect Metode

Definisi

Overload

GenerateSelect(ViewContext, ModelExplorer, String, String, IEnumerable<SelectListItem>, Boolean, Object)

Buat elemen pilih <> untuk expression.

GenerateSelect(ViewContext, ModelExplorer, String, String, IEnumerable<SelectListItem>, ICollection<String>, Boolean, Object)

Buat elemen pilih <> untuk expression.

GenerateSelect(ViewContext, ModelExplorer, String, String, IEnumerable<SelectListItem>, Boolean, Object)

Sumber:
DefaultHtmlGenerator.cs
Sumber:
DefaultHtmlGenerator.cs
Sumber:
DefaultHtmlGenerator.cs

Buat elemen pilih <> untuk expression.

public:
 virtual Microsoft::AspNetCore::Mvc::Rendering::TagBuilder ^ GenerateSelect(Microsoft::AspNetCore::Mvc::Rendering::ViewContext ^ viewContext, Microsoft::AspNetCore::Mvc::ViewFeatures::ModelExplorer ^ modelExplorer, System::String ^ optionLabel, System::String ^ expression, System::Collections::Generic::IEnumerable<Microsoft::AspNetCore::Mvc::Rendering::SelectListItem ^> ^ selectList, bool allowMultiple, System::Object ^ htmlAttributes);
public Microsoft.AspNetCore.Mvc.Rendering.TagBuilder GenerateSelect (Microsoft.AspNetCore.Mvc.Rendering.ViewContext viewContext, Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer modelExplorer, string optionLabel, string expression, System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Mvc.Rendering.SelectListItem> selectList, bool allowMultiple, object htmlAttributes);
abstract member GenerateSelect : Microsoft.AspNetCore.Mvc.Rendering.ViewContext * Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer * string * string * seq<Microsoft.AspNetCore.Mvc.Rendering.SelectListItem> * bool * obj -> Microsoft.AspNetCore.Mvc.Rendering.TagBuilder
override this.GenerateSelect : Microsoft.AspNetCore.Mvc.Rendering.ViewContext * Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer * string * string * seq<Microsoft.AspNetCore.Mvc.Rendering.SelectListItem> * bool * obj -> Microsoft.AspNetCore.Mvc.Rendering.TagBuilder
Public Function GenerateSelect (viewContext As ViewContext, modelExplorer As ModelExplorer, optionLabel As String, expression As String, selectList As IEnumerable(Of SelectListItem), allowMultiple As Boolean, htmlAttributes As Object) As TagBuilder

Parameter

viewContext
ViewContext

Instans ViewContext untuk cakupan saat ini.

modelExplorer
ModelExplorer

ModelExplorer expressionuntuk . Jika null, menentukan atribut validasi menggunakan viewContext dan expression.

optionLabel
String

Teks opsional untuk elemen opsi> kosong <default.

expression
String

Nama ekspresi, relatif terhadap model saat ini.

selectList
IEnumerable<SelectListItem>

Kumpulan SelectListItem objek yang digunakan untuk mengisi elemen pilih><dengan <elemen optgroup> dan <opsi>. Jika null, menemukan koleksi ini di ViewContext.ViewData[expression].

allowMultiple
Boolean

Jika true, sertakan multiple atribut dalam HTML yang dihasilkan. Jika tidak, menghasilkan elemen pemilihan <> tunggal.

htmlAttributes
Object

Yang Object berisi atribut HTML untuk elemen pilih<>. Atau, instans yang IDictionary<TKey,TValue> berisi atribut HTML.

Mengembalikan

TagBuilder Baru yang menjelaskan elemen pilih<>.

Penerapan

Berlaku untuk

GenerateSelect(ViewContext, ModelExplorer, String, String, IEnumerable<SelectListItem>, ICollection<String>, Boolean, Object)

Sumber:
DefaultHtmlGenerator.cs
Sumber:
DefaultHtmlGenerator.cs
Sumber:
DefaultHtmlGenerator.cs

Buat elemen pilih <> untuk expression.

public:
 virtual Microsoft::AspNetCore::Mvc::Rendering::TagBuilder ^ GenerateSelect(Microsoft::AspNetCore::Mvc::Rendering::ViewContext ^ viewContext, Microsoft::AspNetCore::Mvc::ViewFeatures::ModelExplorer ^ modelExplorer, System::String ^ optionLabel, System::String ^ expression, System::Collections::Generic::IEnumerable<Microsoft::AspNetCore::Mvc::Rendering::SelectListItem ^> ^ selectList, System::Collections::Generic::ICollection<System::String ^> ^ currentValues, bool allowMultiple, System::Object ^ htmlAttributes);
public virtual Microsoft.AspNetCore.Mvc.Rendering.TagBuilder GenerateSelect (Microsoft.AspNetCore.Mvc.Rendering.ViewContext viewContext, Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer modelExplorer, string optionLabel, string expression, System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Mvc.Rendering.SelectListItem> selectList, System.Collections.Generic.ICollection<string> currentValues, bool allowMultiple, object htmlAttributes);
abstract member GenerateSelect : Microsoft.AspNetCore.Mvc.Rendering.ViewContext * Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer * string * string * seq<Microsoft.AspNetCore.Mvc.Rendering.SelectListItem> * System.Collections.Generic.ICollection<string> * bool * obj -> Microsoft.AspNetCore.Mvc.Rendering.TagBuilder
override this.GenerateSelect : Microsoft.AspNetCore.Mvc.Rendering.ViewContext * Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer * string * string * seq<Microsoft.AspNetCore.Mvc.Rendering.SelectListItem> * System.Collections.Generic.ICollection<string> * bool * obj -> Microsoft.AspNetCore.Mvc.Rendering.TagBuilder
Public Overridable Function GenerateSelect (viewContext As ViewContext, modelExplorer As ModelExplorer, optionLabel As String, expression As String, selectList As IEnumerable(Of SelectListItem), currentValues As ICollection(Of String), allowMultiple As Boolean, htmlAttributes As Object) As TagBuilder

Parameter

viewContext
ViewContext

Instans ViewContext untuk cakupan saat ini.

modelExplorer
ModelExplorer

ModelExplorer expressionuntuk . Jika null, menentukan atribut validasi menggunakan viewContext dan expression.

optionLabel
String

Teks opsional untuk elemen opsi> kosong <default.

expression
String

Nama ekspresi, relatif terhadap model saat ini.

selectList
IEnumerable<SelectListItem>

Kumpulan SelectListItem objek yang digunakan untuk mengisi elemen pilih><dengan <elemen optgroup> dan <opsi>. Jika null, menemukan koleksi ini di ViewContext.ViewData[expression].

currentValues
ICollection<String>

Nilai ICollection<T> yang berisi elemen opsi> untuk <dipilih. Jika null, pilih <elemen opsi> berdasarkan Selected nilai di selectList.

allowMultiple
Boolean

Jika true, sertakan multiple atribut dalam HTML yang dihasilkan. Jika tidak, menghasilkan elemen pemilihan <> tunggal.

htmlAttributes
Object

Yang Object berisi atribut HTML untuk elemen pilih<>. Atau, instans yang IDictionary<TKey,TValue> berisi atribut HTML.

Mengembalikan

TagBuilder Baru yang menjelaskan elemen pilih<>.

Penerapan

Berlaku untuk