Share via


InputExtensions.CheckBox Method

Definition

Overloads

CheckBox(HtmlHelper, String)

Returns a check box input element by using the specified HTML helper and the name of the form field.

CheckBox(HtmlHelper, String, Boolean)

Returns a check box input element by using the specified HTML helper, the name of the form field, and a value to indicate whether the check box is selected.

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

Returns a check box input element by using the specified HTML helper, the name of the form field, and the HTML attributes.

CheckBox(HtmlHelper, String, Object)

Returns a check box input element by using the specified HTML helper, the name of the form field, and the HTML attributes.

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

Returns a check box input element by using the specified HTML helper, the name of the form field, a value to indicate whether the check box is selected, and the HTML attributes.

CheckBox(HtmlHelper, String, Boolean, Object)

Returns a check box input element by using the specified HTML helper, the name of the form field, a value that indicates whether the check box is selected, and the HTML attributes.

CheckBox(HtmlHelper, String)

Returns a check box input element by using the specified HTML helper and the name of the form field.

public static System.Web.Mvc.MvcHtmlString CheckBox (this System.Web.Mvc.HtmlHelper htmlHelper, string name);
static member CheckBox : System.Web.Mvc.HtmlHelper * string -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function CheckBox (htmlHelper As HtmlHelper, name As String) As MvcHtmlString

Parameters

htmlHelper
HtmlHelper

The HTML helper instance that this method extends.

name
String

The name of the form field.

Returns

An input element whose type attribute is set to "checkbox".

Applies to

CheckBox(HtmlHelper, String, Boolean)

Returns a check box input element by using the specified HTML helper, the name of the form field, and a value to indicate whether the check box is selected.

public static System.Web.Mvc.MvcHtmlString CheckBox (this System.Web.Mvc.HtmlHelper htmlHelper, string name, bool isChecked);
static member CheckBox : System.Web.Mvc.HtmlHelper * string * bool -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function CheckBox (htmlHelper As HtmlHelper, name As String, isChecked As Boolean) As MvcHtmlString

Parameters

htmlHelper
HtmlHelper

The HTML helper instance that this method extends.

name
String

The name of the form field.

isChecked
Boolean

true to select the check box; otherwise, false. The value of the check box is retrieved in this order - the ModelStateDictionary object, the value of this parameter, the ViewDataDictionary object, and lastly, a checked attribute in the html attributes.

Returns

An input element whose type attribute is set to "checkbox".

Applies to

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

Returns a check box input element by using the specified HTML helper, the name of the form field, and the HTML attributes.

public static System.Web.Mvc.MvcHtmlString CheckBox (this System.Web.Mvc.HtmlHelper htmlHelper, string name, System.Collections.Generic.IDictionary<string,object> htmlAttributes);
static member CheckBox : System.Web.Mvc.HtmlHelper * string * System.Collections.Generic.IDictionary<string, obj> -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function CheckBox (htmlHelper As HtmlHelper, name As String, htmlAttributes As IDictionary(Of String, Object)) As MvcHtmlString

Parameters

htmlHelper
HtmlHelper

The HTML helper instance that this method extends.

name
String

The name of the form field.

htmlAttributes
IDictionary<String,Object>

An object that contains the HTML attributes to set for the element.

Returns

An input element whose type attribute is set to "checkbox".

Applies to

CheckBox(HtmlHelper, String, Object)

Returns a check box input element by using the specified HTML helper, the name of the form field, and the HTML attributes.

public static System.Web.Mvc.MvcHtmlString CheckBox (this System.Web.Mvc.HtmlHelper htmlHelper, string name, object htmlAttributes);
static member CheckBox : System.Web.Mvc.HtmlHelper * string * obj -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function CheckBox (htmlHelper As HtmlHelper, name As String, htmlAttributes As Object) As MvcHtmlString

Parameters

htmlHelper
HtmlHelper

The HTML helper instance that this method extends.

name
String

The name of the form field.

htmlAttributes
Object

An object that contains the HTML attributes to set for the element.

Returns

An input element whose type attribute is set to "checkbox".

Applies to

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

Returns a check box input element by using the specified HTML helper, the name of the form field, a value to indicate whether the check box is selected, and the HTML attributes.

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

Parameters

htmlHelper
HtmlHelper

The HTML helper instance that this method extends.

name
String

The name of the form field.

isChecked
Boolean

true to select the check box; otherwise, false. The value of the check box is retrieved in this order - the ModelStateDictionary object, the value of this parameter, the ViewDataDictionary object, and lastly, a checked attribute in the html attributes.

htmlAttributes
IDictionary<String,Object>

An object that contains the HTML attributes to set for the element.

Returns

An input element whose type attribute is set to "checkbox".

Applies to

CheckBox(HtmlHelper, String, Boolean, Object)

Returns a check box input element by using the specified HTML helper, the name of the form field, a value that indicates whether the check box is selected, and the HTML attributes.

public static System.Web.Mvc.MvcHtmlString CheckBox (this System.Web.Mvc.HtmlHelper htmlHelper, string name, bool isChecked, object htmlAttributes);
static member CheckBox : System.Web.Mvc.HtmlHelper * string * bool * obj -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function CheckBox (htmlHelper As HtmlHelper, name As String, isChecked As Boolean, htmlAttributes As Object) As MvcHtmlString

Parameters

htmlHelper
HtmlHelper

The HTML helper instance that this method extends.

name
String

The name of the form field.

isChecked
Boolean

true to select the check box; otherwise, false. The value of the check box is retrieved in this order - the ModelStateDictionary object, the value of this parameter, the ViewDataDictionary object, and lastly, a checked attribute in the html attributes.

htmlAttributes
Object

An object that contains the HTML attributes to set for the element.

Returns

An input element whose type attribute is set to "checkbox".

Applies to