DefaultHtmlGenerator.GenerateCheckBox Method

Definition

Generate a <input type="checkbox".../> element.

public:
 virtual Microsoft::AspNetCore::Mvc::Rendering::TagBuilder ^ GenerateCheckBox(Microsoft::AspNetCore::Mvc::Rendering::ViewContext ^ viewContext, Microsoft::AspNetCore::Mvc::ViewFeatures::ModelExplorer ^ modelExplorer, System::String ^ expression, Nullable<bool> isChecked, System::Object ^ htmlAttributes);
public virtual Microsoft.AspNetCore.Mvc.Rendering.TagBuilder GenerateCheckBox (Microsoft.AspNetCore.Mvc.Rendering.ViewContext viewContext, Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer modelExplorer, string expression, bool? isChecked, object htmlAttributes);
abstract member GenerateCheckBox : Microsoft.AspNetCore.Mvc.Rendering.ViewContext * Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer * string * Nullable<bool> * obj -> Microsoft.AspNetCore.Mvc.Rendering.TagBuilder
override this.GenerateCheckBox : Microsoft.AspNetCore.Mvc.Rendering.ViewContext * Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer * string * Nullable<bool> * obj -> Microsoft.AspNetCore.Mvc.Rendering.TagBuilder
Public Overridable Function GenerateCheckBox (viewContext As ViewContext, modelExplorer As ModelExplorer, expression As String, isChecked As Nullable(Of Boolean), htmlAttributes As Object) As TagBuilder

Parameters

viewContext
ViewContext

The ViewContext instance for the current scope.

modelExplorer
ModelExplorer

The ModelExplorer for the expression.

expression
String

Expression name, relative to the current model.

isChecked
Nullable<Boolean>

The initial state of the checkbox element.

htmlAttributes
Object

An Object that contains the HTML attributes for the element. Alternatively, an IDictionary<TKey,TValue> instance containing the HTML attributes.

Returns

A TagBuilder instance for the <input type="checkbox".../> element.

Implements

Applies to