/// <summary> /// RadioButton(注意,js的change事件里,值都是字符串类型 /// 用法: ///@Html.BuildRadioButton("UserType", 0, a => a.SetLabel("专卖店")) ///@Html.BuildRadioButton("UserType", 1, a => { a.SetLabel("顾客"); a.IsChecked(); }) public static MvcHtmlString BuildRadioButton(this HtmlHelper htmlHelper, string name, object value, Action <PFRadioButton> action = null) { var component = new PFRadioButton(); if (action != null) { action(component); } return(component.Html(htmlHelper, name, value)); }
public static MvcHtmlString BuildRadioButtonFor <TModel, TProperty>(this HtmlHelper <TModel> htmlHelper, Expression <Func <TModel, TProperty> > expression, Action <PFRadioButton> action = null) { var component = new PFRadioButton(); if (action != null) { action(component); } return(component.Html(htmlHelper, expression)); }