IHtmlGenerator.GenerateCheckBox Method

Definition

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

C#
public Microsoft.AspNetCore.Mvc.Rendering.TagBuilder GenerateCheckBox (Microsoft.AspNetCore.Mvc.Rendering.ViewContext viewContext, Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer modelExplorer, string expression, bool? isChecked, object htmlAttributes);

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.

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