Share via


InputExtensions.RadioButtonFor 方法

定义

重载

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

使用指定的 HTML 属性,返回对象中由指定表达式表示的每个属性的单选按钮输入元素。

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

返回对象中由指定表达式表示的每个属性的单选按钮输入元素。

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

使用指定的 HTML 属性,返回对象中由指定表达式表示的每个属性的单选按钮输入元素。

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

使用指定的 HTML 属性,返回对象中由指定表达式表示的每个属性的单选按钮输入元素。

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

类型参数

TModel

模型的类型。

TProperty

值的类型。

参数

htmlHelper
HtmlHelper<TModel>

此方法扩展的 HTML 帮助器实例。

expression
Expression<Func<TModel,TProperty>>

一个表达式,用于标识包含要呈现的属性的对象。

value
Object

所选单选按钮的值。 按此顺序检索值 - ModelStateDictionary 对象、此参数的值、 ViewDataDictionary 对象,最后是 html 属性中的值属性。

htmlAttributes
Object

一个 对象,其中包含要为 元素设置的 HTML 属性。

返回

一个 HTML 输入元素,其类型属性设置为“radio”的对象中的每个属性,该属性由指定表达式表示,使用指定的 HTML 属性。

例外

value 参数为 null。

适用于

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

返回对象中由指定表达式表示的每个属性的单选按钮输入元素。

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

类型参数

TModel

模型的类型。

TProperty

值的类型。

参数

htmlHelper
HtmlHelper<TModel>

此方法扩展的 HTML 帮助器实例。

expression
Expression<Func<TModel,TProperty>>

一个表达式,用于标识包含要呈现的属性的对象。

value
Object

所选单选按钮的值。 按此顺序检索值 - ModelStateDictionary 对象、此参数的值、 ViewDataDictionary 对象,最后是 html 属性中的值属性。

返回

一个 HTML input 元素,其 type 特性针对指定表达式表示的对象中的每个属性均设置为“radio”。

例外

value 参数为 null。

适用于

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

使用指定的 HTML 属性,返回对象中由指定表达式表示的每个属性的单选按钮输入元素。

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

类型参数

TModel

模型的类型。

TProperty

值的类型。

参数

htmlHelper
HtmlHelper<TModel>

此方法扩展的 HTML 帮助器实例。

expression
Expression<Func<TModel,TProperty>>

一个表达式,用于标识包含要呈现的属性的对象。

value
Object

所选单选按钮的值。 按此顺序检索值 - ModelStateDictionary 对象、此参数的值、 ViewDataDictionary 对象,最后是 html 属性中的值属性。

htmlAttributes
IDictionary<String,Object>

一个包含要为该元素设置的 HTML 特性的字典。

返回

一个 HTML 输入元素,其类型属性设置为“radio”的对象中的每个属性,该属性由指定表达式表示,使用指定的 HTML 属性。

例外

value 参数为 null。

适用于