Compartir a través de


DefaultHtmlGenerator.GenerateSelect Método

Definición

Sobrecargas

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

Genere un <elemento select> para .expression

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

Genere un <elemento select> para .expression

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

Source:
DefaultHtmlGenerator.cs
Source:
DefaultHtmlGenerator.cs
Source:
DefaultHtmlGenerator.cs

Genere un <elemento select> para .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

Parámetros

viewContext
ViewContext

Una ViewContext instancia del ámbito actual.

modelExplorer
ModelExplorer

ModelExplorerpara .expression Si nulles , determina los atributos de validación mediante viewContext y expression.

optionLabel
String

Texto opcional para un elemento de opción> vacío predeterminado<.

expression
String

Nombre de expresión, en relación con el modelo actual.

selectList
IEnumerable<SelectListItem>

Colección de SelectListItem objetos usados para rellenar el <elemento select> con <elementos optgroup> y <option> . Si nulles , encuentra esta colección en ViewContext.ViewData[expression].

allowMultiple
Boolean

Si truees , incluye un multiple atributo en el CÓDIGO HTML generado. De lo contrario, genera un elemento select> de selección <única.

htmlAttributes
Object

que Object contiene los atributos HTML del <elemento select> . Como alternativa, una IDictionary<TKey,TValue> instancia de que contiene los atributos HTML.

Devoluciones

Nuevo TagBuilder que describe el <elemento select> .

Implementaciones

Se aplica a

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

Source:
DefaultHtmlGenerator.cs
Source:
DefaultHtmlGenerator.cs
Source:
DefaultHtmlGenerator.cs

Genere un <elemento select> para .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

Parámetros

viewContext
ViewContext

Una ViewContext instancia del ámbito actual.

modelExplorer
ModelExplorer

ModelExplorerpara .expression Si nulles , determina los atributos de validación mediante viewContext y expression.

optionLabel
String

Texto opcional para un elemento de opción> vacío predeterminado<.

expression
String

Nombre de expresión, en relación con el modelo actual.

selectList
IEnumerable<SelectListItem>

Colección de SelectListItem objetos usados para rellenar el <elemento select> con <elementos optgroup> y <option> . Si nulles , encuentra esta colección en ViewContext.ViewData[expression].

currentValues
ICollection<String>

Que ICollection<T> contiene valores para <los elementos de opción> que se van a seleccionar. Si nulles , selecciona los <elementos de opción> en función de los Selected valores de selectList.

allowMultiple
Boolean

Si truees , incluye un multiple atributo en el CÓDIGO HTML generado. De lo contrario, genera un elemento select> de selección <única.

htmlAttributes
Object

que Object contiene los atributos HTML del <elemento select> . Como alternativa, una IDictionary<TKey,TValue> instancia de que contiene los atributos HTML.

Devoluciones

Nuevo TagBuilder que describe el <elemento select> .

Implementaciones

Se aplica a