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.
精彩评论