HtmlHelper.CheckBox HtmlHelper.CheckBox HtmlHelper.CheckBox Method

Definition

Overloads

CheckBox(String) CheckBox(String) CheckBox(String)

Returns an HTML check box control that has the specified name.

CheckBox(String, Boolean) CheckBox(String, Boolean) CheckBox(String, Boolean)

Returns an HTML check box control that has the specified name and default checked status.

CheckBox(String, IDictionary<String,Object>) CheckBox(String, IDictionary<String,Object>) CheckBox(String, IDictionary<String,Object>)

Returns an HTML check box control that has the specified name and custom attributes defined by an attribute dictionary.

CheckBox(String, Object) CheckBox(String, Object) CheckBox(String, Object)

Returns an HTML check box control that has the specified name and custom attributes defined by an attribute object.

CheckBox(String, Boolean, IDictionary<String,Object>) CheckBox(String, Boolean, IDictionary<String,Object>) CheckBox(String, Boolean, IDictionary<String,Object>)

Returns an HTML check box control that has the specified name, default checked status, and custom attributes defined by an attribute dictionary.

CheckBox(String, Boolean, Object) CheckBox(String, Boolean, Object) CheckBox(String, Boolean, Object)

Returns an HTML check box control that has the specified name, default checked status, and custom attributes defined by an attribute object.

CheckBox(String) CheckBox(String) CheckBox(String)

Returns an HTML check box control that has the specified name.

public System.Web.IHtmlString CheckBox (string name);
member this.CheckBox : string -> System.Web.IHtmlString
Public Function CheckBox (name As String) As IHtmlString
Parameters
name
String String String

The value to assign to the name attribute of the HTML control element.

Returns

The HTML markup that represents the check box control.

Exceptions
Sytem.ArgumentException Sytem.ArgumentException Sytem.ArgumentException

name is null or empty.

CheckBox(String, Boolean) CheckBox(String, Boolean) CheckBox(String, Boolean)

Returns an HTML check box control that has the specified name and default checked status.

public System.Web.IHtmlString CheckBox (string name, bool isChecked);
member this.CheckBox : string * bool -> System.Web.IHtmlString
Public Function CheckBox (name As String, isChecked As Boolean) As IHtmlString
Parameters
name
String String String

The value to assign to the name attribute of the HTML control element.

isChecked
Boolean Boolean Boolean

true to indicate that the checked attribute is set to checked; otherwise, false.

Returns

The HTML markup that represents the check box control.

Exceptions
Sytem.ArgumentException Sytem.ArgumentException Sytem.ArgumentException

name is null or empty.

CheckBox(String, IDictionary<String,Object>) CheckBox(String, IDictionary<String,Object>) CheckBox(String, IDictionary<String,Object>)

Returns an HTML check box control that has the specified name and custom attributes defined by an attribute dictionary.

public System.Web.IHtmlString CheckBox (string name, System.Collections.Generic.IDictionary<string,object> htmlAttributes);
member this.CheckBox : string * System.Collections.Generic.IDictionary<string, obj> -> System.Web.IHtmlString
Public Function CheckBox (name As String, htmlAttributes As IDictionary(Of String, Object)) As IHtmlString
Parameters
name
String String String

The value to assign to the name attribute of the HTML control element.

htmlAttributes
IDictionary<String,Object>

The names and values of custom attributes for the element.

Returns

The HTML markup that represents the check box control.

Exceptions
Sytem.ArgumentException Sytem.ArgumentException Sytem.ArgumentException

name is null or empty.

CheckBox(String, Object) CheckBox(String, Object) CheckBox(String, Object)

Returns an HTML check box control that has the specified name and custom attributes defined by an attribute object.

public System.Web.IHtmlString CheckBox (string name, object htmlAttributes);
member this.CheckBox : string * obj -> System.Web.IHtmlString
Public Function CheckBox (name As String, htmlAttributes As Object) As IHtmlString
Parameters
name
String String String

The value to assign to the name attribute of the HTML control element.

htmlAttributes
Object Object Object

An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object.

Returns

The HTML markup that represents the check box control.

Exceptions
Sytem.ArgumentException Sytem.ArgumentException Sytem.ArgumentException

name is null or empty.

CheckBox(String, Boolean, IDictionary<String,Object>) CheckBox(String, Boolean, IDictionary<String,Object>) CheckBox(String, Boolean, IDictionary<String,Object>)

Returns an HTML check box control that has the specified name, default checked status, and custom attributes defined by an attribute dictionary.

public System.Web.IHtmlString CheckBox (string name, bool isChecked, System.Collections.Generic.IDictionary<string,object> htmlAttributes);
member this.CheckBox : string * bool * System.Collections.Generic.IDictionary<string, obj> -> System.Web.IHtmlString
Public Function CheckBox (name As String, isChecked As Boolean, htmlAttributes As IDictionary(Of String, Object)) As IHtmlString
Parameters
name
String String String

The value to assign to the name attribute of the HTML control element.

isChecked
Boolean Boolean Boolean

true to indicate that the checked attribute is set to checked; otherwise, false.

htmlAttributes
IDictionary<String,Object>

The names and values of custom attributes for the element.

Returns

The HTML markup that represents the check box control.

Exceptions
Sytem.ArgumentException Sytem.ArgumentException Sytem.ArgumentException

name is null or empty.

CheckBox(String, Boolean, Object) CheckBox(String, Boolean, Object) CheckBox(String, Boolean, Object)

Returns an HTML check box control that has the specified name, default checked status, and custom attributes defined by an attribute object.

public System.Web.IHtmlString CheckBox (string name, bool isChecked, object htmlAttributes);
member this.CheckBox : string * bool * obj -> System.Web.IHtmlString
Public Function CheckBox (name As String, isChecked As Boolean, htmlAttributes As Object) As IHtmlString
Parameters
name
String String String

The value to assign to the name attribute of the HTML control element.

isChecked
Boolean Boolean Boolean

true to indicate that the checked attribute is set to checked; otherwise, false.

htmlAttributes
Object Object Object

An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object.

Returns

The HTML markup that represents the check box control.

Exceptions
Sytem.ArgumentException Sytem.ArgumentException Sytem.ArgumentException

name is null or empty.

Applies to