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”.../> 元素的<实例。

适用于