Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/68.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
MVC:无法使用Jquery从网格中删除行_Jquery_Asp.net Mvc - Fatal编程技术网

MVC:无法使用Jquery从网格中删除行

MVC:无法使用Jquery从网格中删除行,jquery,asp.net-mvc,Jquery,Asp.net Mvc,我知道使用AJAX删除网格中的一行是一种很好的做法。 所以我在这里找到了关于如何做的参考 然而,当我尝试创建html帮助程序时,我发现RouteLink属性下面有一条红线——intellisense说它不存在。 我做错了什么 public static string DeleteEmployeeOtherLeave(this HtmlHelper html, string linkText , Leave employeeOtherLeave) {

我知道使用AJAX删除网格中的一行是一种很好的做法。 所以我在这里找到了关于如何做的参考

然而,当我尝试创建html帮助程序时,我发现RouteLink属性下面有一条红线——intellisense说它不存在。 我做错了什么

        public static string DeleteEmployeeOtherLeave(this HtmlHelper html, string linkText
  , Leave employeeOtherLeave)
        {
            return html.RouteLink(linkText, "Payroll",
                new { _employeeOtherLeaveId = employeeOtherLeave.LeaveId, action = "Delete" },
                new { onclick = "$.post(this.href); return false;" });
        }

扩展方法在属于
System.Web.Mvc.Html
命名空间的类中定义。因此,您需要使用System.Web.Mvc.Html在文件顶部添加

您已经正确回答了问题,我将为此为您打勾。然而,我得到了我的观点的红线。这是为什么?@arame3333,因为在您的视图中,您还需要包括定义此自定义帮助程序的命名空间:
,或者只需将其添加到
web.config
命名空间
部分。