Share via


InputExtensions.RadioButton Method

Definition

Overloads

RadioButton(HtmlHelper, String, Object)

Returns a radio button input element that is used to present mutually exclusive options.

RadioButton(HtmlHelper, String, Object, Boolean)

Returns a radio button input element that is used to present mutually exclusive options.

RadioButton(HtmlHelper, String, Object, IDictionary<String,Object>)

Returns a radio button input element that is used to present mutually exclusive options.

RadioButton(HtmlHelper, String, Object, Object)

Returns a radio button input element that is used to present mutually exclusive options.

RadioButton(HtmlHelper, String, Object, Boolean, IDictionary<String,Object>)

Returns a radio button input element that is used to present mutually exclusive options.

RadioButton(HtmlHelper, String, Object, Boolean, Object)

Returns a radio button input element that is used to present mutually exclusive options.

RadioButton(HtmlHelper, String, Object)

Returns a radio button input element that is used to present mutually exclusive options.

public static System.Web.Mvc.MvcHtmlString RadioButton (this System.Web.Mvc.HtmlHelper htmlHelper, string name, object value);
static member RadioButton : System.Web.Mvc.HtmlHelper * string * obj -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function RadioButton (htmlHelper As HtmlHelper, name As String, value As Object) As MvcHtmlString

Parameters

htmlHelper
HtmlHelper

The HTML helper instance that this method extends.

name
String

The name of the form field and the ViewDataDictionary key that is used to look up the value.

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 input element whose type attribute is set to "radio".

Exceptions

The name parameter is null or empty.

The value parameter is null.

Applies to

RadioButton(HtmlHelper, String, Object, Boolean)

Returns a radio button input element that is used to present mutually exclusive options.

public static System.Web.Mvc.MvcHtmlString RadioButton (this System.Web.Mvc.HtmlHelper htmlHelper, string name, object value, bool isChecked);
static member RadioButton : System.Web.Mvc.HtmlHelper * string * obj * bool -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function RadioButton (htmlHelper As HtmlHelper, name As String, value As Object, isChecked As Boolean) As MvcHtmlString

Parameters

htmlHelper
HtmlHelper

The HTML helper instance that this method extends.

name
String

The name of the form field and the ViewDataDictionary key that is used to look up the value.

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.

isChecked
Boolean

true to select the radio button; otherwise, false.

Returns

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

Exceptions

The name parameter is null or empty.

The value parameter is null.

Applies to

RadioButton(HtmlHelper, String, Object, IDictionary<String,Object>)

Returns a radio button input element that is used to present mutually exclusive options.

public static System.Web.Mvc.MvcHtmlString RadioButton (this System.Web.Mvc.HtmlHelper htmlHelper, string name, object value, System.Collections.Generic.IDictionary<string,object> htmlAttributes);
static member RadioButton : System.Web.Mvc.HtmlHelper * string * obj * System.Collections.Generic.IDictionary<string, obj> -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function RadioButton (htmlHelper As HtmlHelper, name As String, value As Object, htmlAttributes As IDictionary(Of String, Object)) As MvcHtmlString

Parameters

htmlHelper
HtmlHelper

The HTML helper instance that this method extends.

name
String

The name of the form field and the ViewDataDictionary key that is used to look up the value.

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>

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

Returns

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

Exceptions

The name parameter is null or empty.

The value parameter is null.

Applies to

RadioButton(HtmlHelper, String, Object, Object)

Returns a radio button input element that is used to present mutually exclusive options.

public static System.Web.Mvc.MvcHtmlString RadioButton (this System.Web.Mvc.HtmlHelper htmlHelper, string name, object value, object htmlAttributes);
static member RadioButton : System.Web.Mvc.HtmlHelper * string * obj * obj -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function RadioButton (htmlHelper As HtmlHelper, name As String, value As Object, htmlAttributes As Object) As MvcHtmlString

Parameters

htmlHelper
HtmlHelper

The HTML helper instance that this method extends.

name
String

The name of the form field and the ViewDataDictionary key that is used to look up the value.

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 input element whose type attribute is set to "radio".

Exceptions

The name parameter is null or empty.

The value parameter is null.

Applies to

RadioButton(HtmlHelper, String, Object, Boolean, IDictionary<String,Object>)

Returns a radio button input element that is used to present mutually exclusive options.

public static System.Web.Mvc.MvcHtmlString RadioButton (this System.Web.Mvc.HtmlHelper htmlHelper, string name, object value, bool isChecked, System.Collections.Generic.IDictionary<string,object> htmlAttributes);
static member RadioButton : System.Web.Mvc.HtmlHelper * string * obj * bool * System.Collections.Generic.IDictionary<string, obj> -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function RadioButton (htmlHelper As HtmlHelper, name As String, value As Object, isChecked As Boolean, htmlAttributes As IDictionary(Of String, Object)) As MvcHtmlString

Parameters

htmlHelper
HtmlHelper

The HTML helper instance that this method extends.

name
String

The name of the form field and the ViewDataDictionary key that is used to look up the value.

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.

isChecked
Boolean

true to select the radio button; otherwise, false.

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 "radio".

Exceptions

The name parameter is null or empty.

The value parameter is null.

Applies to

RadioButton(HtmlHelper, String, Object, Boolean, Object)

Returns a radio button input element that is used to present mutually exclusive options.

public static System.Web.Mvc.MvcHtmlString RadioButton (this System.Web.Mvc.HtmlHelper htmlHelper, string name, object value, bool isChecked, object htmlAttributes);
static member RadioButton : System.Web.Mvc.HtmlHelper * string * obj * bool * obj -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function RadioButton (htmlHelper As HtmlHelper, name As String, value As Object, isChecked As Boolean, htmlAttributes As Object) As MvcHtmlString

Parameters

htmlHelper
HtmlHelper

The HTML helper instance that this method extends.

name
String

The name of the form field and the ViewDataDictionary key that is used to look up the value.

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.

isChecked
Boolean

true to select the radio button; otherwise, false.

htmlAttributes
Object

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

Returns

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

Exceptions

The name parameter is null or empty.

The value parameter is null.

Applies to