DefaultHtmlGenerator.GenerateCheckBox 方法

定义

生成 <输入类型=“checkbox”.../> 元素。

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

参数

viewContext
ViewContext

ViewContext当前范围的实例。

modelExplorer
ModelExplorer

ModelExplorerexpression

expression
String

表达式名称,相对于当前模型。

isChecked
Nullable<Boolean>

复选框元素的初始状态。

htmlAttributes
Object

一个 Object ,它包含 元素的 HTML 属性。 或者,一个 IDictionary<TKey,TValue> 包含 HTML 属性的实例。

返回

TagBuilder输入 type=“checkbox”.../> 元素的<实例。

实现

适用于