我想用我的网页上创建自定义HTML按钮此
public static class HtmlButtonExtension
{
public static MvcHtmlString Button(this HtmlHelper helper, string text,
IDictionary<string, object> htmlAttributes)
{
var builder = new TagBuilder("button");
builder.InnerHtml = text;
builder.MergeAttributes(htmlAttributes);
return MvcHtmlString.Create(builder.ToString());
}
}
当我点击这个按钮,我想一个recordId所传递给我的行动
下面给出的是什么,我加入到我的Razor视图
@ Html.Button( “删除”,新的{名称= “的CustomButton” 的recordId = “1”})
但我无法得到显示这个按钮,它的投掷误差修改
'System.Web.Mvc.HtmlHelper<wmyWebRole.ViewModels.MyViewModel>' does not contain a definition for 'Button' and the best extension method overload 'JSONServiceRole.Utilities.HtmlButtonExtension.Button(System.Web.Mvc.HtmlHelper, string, System.Collections.Generic.IDictionary<string,object>)' has some invalid arguments
可有一个人帮我找出实际的错误