Export (0) Print
Expand All

InputExtensions.CheckBox Method

.NET Framework 4

Returns a check box input element that enables the user to select a true or false condition.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  NameDescription
Public method Static member CheckBox(HtmlHelper, String) Returns a check box input element by using the specified HTML helper and the name of the form field.
Public method Static member 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 method Static member 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 method Static member 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 method Static member 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 method Static member 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.
Top

In addition to rendering a check box input element, this method renders a hidden input element so that an unselected check box will return false.

The difference between calling the CheckBox method and using an input element is that the CheckBox method is designed to make it easy to bind to view data or model data.

Community Additions

ADD
Show:
© 2014 Microsoft