InputExtensions.CheckBox InputExtensions.CheckBox Method

Definition

Overloads

CheckBox(HtmlHelper, String) 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) 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>) 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) 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>) 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) 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) 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

Parameters

htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method extends.

name
String String

The name of the form field.

Returns

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

CheckBox(HtmlHelper, String, Boolean) 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

Parameters

htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method extends.

name
String String

The name of the form field.

isChecked
Boolean 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".

CheckBox(HtmlHelper, String, IDictionary<String,Object>) 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

Parameters

htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method extends.

name
String 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".

CheckBox(HtmlHelper, String, Object) 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

Parameters

htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method extends.

name
String String

The name of the form field.

htmlAttributes
Object Object

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

Returns

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

CheckBox(HtmlHelper, String, Boolean, IDictionary<String,Object>) 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

Parameters

htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method extends.

name
String String

The name of the form field.

isChecked
Boolean 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".

CheckBox(HtmlHelper, String, Boolean, Object) 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

Parameters

htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method extends.

name
String String

The name of the form field.

isChecked
Boolean 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 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