开发者

MVC: Cannot delete a row from the grid using Jquery

开发者 https://www.devze.com 2023-02-08 19:46 出处:网络
I understand it is good practice to delete a row in a grid using AJAX. So I found this reference as to how to do it here;

I understand it is good practice to delete a row in a grid using AJAX. So I found this reference as to how to do it here;

http://haacked.com/archive/2009/01/30/simple-jquery-delete-link-for-asp.net-mvc.aspx

However when I try to created a html helper, I find that the RouteLink property has a red line underneath it - intellisense says it doesn't exist. What am I doing wrong?

        public static string DeleteEmplo开发者_开发问答yeeOtherLeave(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;" });
        }


The RouteLink extension method is defined in a class belonging to the System.Web.Mvc.Html namespace. So you need to add using System.Web.Mvc.Html at the top of your file.

0

精彩评论

暂无评论...
验证码 换一张
取 消