InputExtensions.RadioButtonFor Method
Returns a radio button input element for each property in the object that is represented by an expression.
Assembly: System.Web.Mvc (in System.Web.Mvc.dll)
| Name | Description | |
|---|---|---|
![]() ![]() | RadioButtonFor(Of TModel, TProperty)(HtmlHelper(Of TModel), Expression(Of Func(Of TModel, TProperty)), Object) | Returns a radio button input element for each property in the object that is represented by the specified expression. |
![]() ![]() | RadioButtonFor(Of TModel, TProperty)(HtmlHelper(Of TModel), Expression(Of Func(Of TModel, TProperty)), Object, IDictionary(Of String, Object)) | Returns a radio button input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. |
![]() ![]() | RadioButtonFor(Of TModel, TProperty)(HtmlHelper(Of TModel), Expression(Of Func(Of TModel, TProperty)), Object, Object) | Returns a radio button input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. |
InputExtensions.RadioButtonFor(Of TModel, TProperty) Method (HtmlHelper(Of TModel), Expression(Of Func(Of TModel, TProperty)), Object)
Returns a radio button input element for each property in the object that is represented by the specified expression.
<ExtensionAttribute> Public Shared Function RadioButtonFor(Of TModel, TProperty) ( htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TProperty)), value 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 TModel, TProperty))
An expression that identifies the object that contains the properties to render.
- value
-
Type:
System.Object
The value of the selected radio button. The value is retrieved in this order - the ModelStateDictionary object, the value of this parameter, the ViewDataDictionary object, and lastly, a value attribute in the html attributes.
Return Value
Type: System.Web.Mvc.MvcHtmlStringAn HTML input element whose type attribute is set to "radio" for each property in the object that is represented by the specified expression.
Type Parameters
- TModel
The type of the model.
- TProperty
The type of the value.
| Exception | Condition |
|---|---|
| ArgumentNullException | The value parameter is null. |
InputExtensions.RadioButtonFor(Of TModel, TProperty) Method (HtmlHelper(Of TModel), Expression(Of Func(Of TModel, TProperty)), Object, IDictionary(Of String, Object))
Returns a radio button input element for each property in the object that is represented by the specified expression, using the specified HTML attributes.
<ExtensionAttribute> Public Shared Function RadioButtonFor(Of TModel, TProperty) ( htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TProperty)), value As Object, htmlAttributes As IDictionary(Of String, 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 TModel, TProperty))
An expression that identifies the object that contains the properties to render.
- value
-
Type:
System.Object
The value of the selected radio button. The value is retrieved in this order - the ModelStateDictionary object, the value of this parameter, the ViewDataDictionary object, and lastly, a value attribute in the html attributes.
- htmlAttributes
-
Type:
System.Collections.Generic.IDictionary(Of String, Object)
A dictionary that contains the HTML attributes to set for the element.
Return Value
Type: System.Web.Mvc.MvcHtmlStringAn HTML input element whose type attribute is set to "radio" 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.
- TProperty
The type of the value.
| Exception | Condition |
|---|---|
| ArgumentNullException | The value parameter is null. |
InputExtensions.RadioButtonFor(Of TModel, TProperty) Method (HtmlHelper(Of TModel), Expression(Of Func(Of TModel, TProperty)), Object, Object)
Returns a radio button input element for each property in the object that is represented by the specified expression, using the specified HTML attributes.
<ExtensionAttribute> Public Shared Function RadioButtonFor(Of TModel, TProperty) ( htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TProperty)), value As Object, 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 TModel, TProperty))
An expression that identifies the object that contains the properties to render.
- value
-
Type:
System.Object
The value of the selected radio button. The value is retrieved in this order - the ModelStateDictionary object, the value of this parameter, the ViewDataDictionary object, and lastly, a value attribute in the html attributes.
- htmlAttributes
-
Type:
System.Object
An object that contains the HTML attributes to set for the element.
Return Value
Type: System.Web.Mvc.MvcHtmlStringAn HTML input element whose type attribute is set to "radio" 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.
- TProperty
The type of the value.
| Exception | Condition |
|---|---|
| ArgumentNullException | The value parameter is null. |

