InputExtensions.CheckBoxFor Method

 

Returns a check box input element for each property in the object that is represented by an expression.

Namespace:   System.Web.Mvc.Html
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticCheckBoxFor(Of TModel)(HtmlHelper(Of TModel), Expression(Of Func(Of TModel, Boolean)))

Returns a check box input element for each property in the object that is represented by the specified expression.

System_CAPS_pubmethodSystem_CAPS_staticCheckBoxFor(Of TModel)(HtmlHelper(Of TModel), Expression(Of Func(Of TModel, Boolean)), IDictionary(Of String, Object))

Returns a check box input element for each property in the object that is represented by the specified expression, using the specified HTML attributes.

System_CAPS_pubmethodSystem_CAPS_staticCheckBoxFor(Of TModel)(HtmlHelper(Of TModel), Expression(Of Func(Of TModel, Boolean)), Object)

Returns a check box input element for each property in the object that is represented by the specified expression, using the specified HTML attributes.

Return to top

InputExtensions.CheckBoxFor(Of TModel) Method (HtmlHelper(Of TModel), Expression(Of Func(Of TModel, Boolean)))

Returns a check box input element for each property in the object that is represented by the specified expression.

<ExtensionAttribute>
Public Shared Function CheckBoxFor(Of TModel) (
	htmlHelper As HtmlHelper(Of TModel),
	expression As Expression(Of Func(Of TModel, Boolean))
) As MvcHtmlString

Parameters

htmlHelper
Type: System.Web.Mvc.HtmlHelper(Of TModel)

The HTML helper instance that this method extends.

expression
Type: System.Linq.Expressions.Expression(Of Func(Of TModelBoolean))

An expression that identifies the object that contains the properties to render.

Return Value

Type: System.Web.Mvc.MvcHtmlString

An HTML input element whose type attribute is set to "checkbox" for each property in the object that is represented by the specified expression.

Type Parameters

TModel

The type of the model.

Exception Condition
ArgumentNullException

The expression parameter is null.

Return to top

InputExtensions.CheckBoxFor(Of TModel) Method (HtmlHelper(Of TModel), Expression(Of Func(Of TModel, Boolean)), IDictionary(Of String, Object))

Returns a check box input element for each property in the object that is represented by the specified expression, using the specified HTML attributes.

<ExtensionAttribute>
Public Shared Function CheckBoxFor(Of TModel) (
	htmlHelper As HtmlHelper(Of TModel),
	expression As Expression(Of Func(Of TModel, Boolean)),
	htmlAttributes As IDictionary(Of StringObject)
) As MvcHtmlString

Parameters

htmlHelper
Type: System.Web.Mvc.HtmlHelper(Of TModel)

The HTML helper instance that this method extends.

expression
Type: System.Linq.Expressions.Expression(Of Func(Of TModelBoolean))

An expression that identifies the object that contains the properties to render.

htmlAttributes
Type: System.Collections.Generic.IDictionary(Of StringObject)

A dictionary that contains the HTML attributes to set for the element.

Return Value

Type: System.Web.Mvc.MvcHtmlString

An HTML input element whose type attribute is set to "checkbox" for each property in the object that is represented by the specified expression, using the specified HTML attributes.

Type Parameters

TModel

The type of the model.

Exception Condition
ArgumentNullException

The expression parameter is null.

Return to top

InputExtensions.CheckBoxFor(Of TModel) Method (HtmlHelper(Of TModel), Expression(Of Func(Of TModel, Boolean)), Object)

Returns a check box input element for each property in the object that is represented by the specified expression, using the specified HTML attributes.

<ExtensionAttribute>
Public Shared Function CheckBoxFor(Of TModel) (
	htmlHelper As HtmlHelper(Of TModel),
	expression As Expression(Of Func(Of TModel, Boolean)),
	htmlAttributes As Object
) As MvcHtmlString

Parameters

htmlHelper
Type: System.Web.Mvc.HtmlHelper(Of TModel)

The HTML helper instance that this method extends.

expression
Type: System.Linq.Expressions.Expression(Of Func(Of TModelBoolean))

An expression that identifies the object that contains the properties to render.

htmlAttributes
Type: System.Object

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

Return Value

Type: System.Web.Mvc.MvcHtmlString

An HTML input element whose type attribute is set to "checkbox" for each property in the object that is represented by the specified expression, using the specified HTML attributes.

Type Parameters

TModel

The type of the model.

Exception Condition
ArgumentNullException

The expression parameter is null.

Return to top
Show: