Share via


InputExtensions.RadioButtonFor Method

Definition

Overloads

RadioButtonFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<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.

RadioButtonFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, Object)

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

RadioButtonFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, Object, IDictionary<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<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<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.

public static System.Web.Mvc.MvcHtmlString RadioButtonFor<TModel,TProperty> (this System.Web.Mvc.HtmlHelper<TModel> htmlHelper, System.Linq.Expressions.Expression<Func<TModel,TProperty>> expression, object value, object htmlAttributes);
static member RadioButtonFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Property>> * obj * obj -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public 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

Type Parameters

TModel

The type of the model.

TProperty

The type of the value.

Parameters

htmlHelper
HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression
Expression<Func<TModel,TProperty>>

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

value
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
Object

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

Returns

An 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.

Exceptions

The value parameter is null.

Applies to

RadioButtonFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, Object)

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

public static System.Web.Mvc.MvcHtmlString RadioButtonFor<TModel,TProperty> (this System.Web.Mvc.HtmlHelper<TModel> htmlHelper, System.Linq.Expressions.Expression<Func<TModel,TProperty>> expression, object value);
static member RadioButtonFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Property>> * obj -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function RadioButtonFor(Of TModel, TProperty) (htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TProperty)), value As Object) As MvcHtmlString

Type Parameters

TModel

The type of the model.

TProperty

The type of the value.

Parameters

htmlHelper
HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression
Expression<Func<TModel,TProperty>>

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

value
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.

Returns

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

Exceptions

The value parameter is null.

Applies to

RadioButtonFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, Object, IDictionary<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.

public static System.Web.Mvc.MvcHtmlString RadioButtonFor<TModel,TProperty> (this System.Web.Mvc.HtmlHelper<TModel> htmlHelper, System.Linq.Expressions.Expression<Func<TModel,TProperty>> expression, object value, System.Collections.Generic.IDictionary<string,object> htmlAttributes);
static member RadioButtonFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Property>> * obj * System.Collections.Generic.IDictionary<string, obj> -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public 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

Type Parameters

TModel

The type of the model.

TProperty

The type of the value.

Parameters

htmlHelper
HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression
Expression<Func<TModel,TProperty>>

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

value
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
IDictionary<String,Object>

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

Returns

An 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.

Exceptions

The value parameter is null.

Applies to