0
我尝试在MVC中构建帮助程序。我尝试过这样的参数:如何通过委托参数传递提取参数
@Html.InputHandler(settings =>
{
settings.Name = "Julio";
settings.Mask = "000-000-000";
settings.visible = false;
settings.Label = true;
settings.htmlAttributes = new { @class="form-control" }
})
我对的参数定义
public delegate void Action<in T>(T obj);
public class InputSettings : SettingsBase
{
public string Name { get; set; }
public bool Label { get; set; }
public string Binding { get; set; }
public bool visible { get; set; }
public object htmlAttributes { get; set; }
public string Mask { get; set; }
}
问题是我无法从助手传递的值下面的代码
public static MvcHtmlString InputHandler(this HtmlHelper htmlHelper, Action<InputSettings> method)
{
var parameters = method. ???
return new MvcHtmlString("");
}
感谢的!
工作正常!非常感谢 – user3582756