共用方式為


IHtmlGenerator.GenerateCheckBox 方法

定義

<產生輸入類型=「checkbox」.../ > 元素。

public:
 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 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
Public Function GenerateCheckBox (viewContext As ViewContext, modelExplorer As ModelExplorer, expression As String, isChecked As Nullable(Of Boolean), htmlAttributes As Object) As TagBuilder

參數

viewContext
ViewContext

ViewContext目前範圍的 實例。

modelExplorer
ModelExplorer

ModelExplorerexpression

expression
String

相對於目前模型的運算式名稱。

isChecked
Nullable<Boolean>

核取方塊專案的初始狀態。

htmlAttributes
Object

Object,其中包含 專案的 HTML 屬性。 或者, IDictionary<TKey,TValue> 包含 HTML 屬性的實例。

傳回

TagBuilder輸入 type=「checkbox」.../ > 元素的 < 實例。

適用於