使用指定的 HTML 特性,为由指定表达式表示的对象中的每个属性返回对应的单选按钮 input 元素。
public static System.Web.Mvc.MvcHtmlString RadioButtonFor (this System.Web.Mvc.HtmlHelper htmlHelper, System.Linq.Expressions.Expression> expression, object value, System.Collections.Generic.IDictionary htmlAttributes);
static member RadioButtonFor : System.Web.Mvc.HtmlHelper * System.Linq.Expressions.Expression> * obj * System.Collections.Generic.IDictionary -> System.Web.Mvc.MvcHtmlString
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
值的类型。
参数
此方法扩展的 HTML 帮助器实例。
expression
Expression>
一个表达式,用于标识包含要呈现的属性的对象。
所选单选按钮的值。 按此顺序检索值: ModelStateDictionary 对象、此参数的值、 ViewDataDictionary 对象,最后是 html 特性中的值特性。
一个包含要为该元素设置的 HTML 特性的字典。
返回
一个 HTML input 元素,其 type 特性对于指定表达式表示的对象中的每个属性均设置为 "单选",并使用指定的 HTML 特性。
例外
适用于