From what I can see, there are various extension methods for HtmlHelper. There is a class called LinkExtensions that holds various extension methods related to links. I want to add an additional ActionLink extension that has a different number of parameters (so another overriden method called ActionLink). How do I go about doing this?
So far I have done this, and it does not work (doesn’t appear as an extension method):
public static class ActionLinkExtensions
{
public static MvcHtmlString ActionLink(this HtmlHelper helper, String linkText, int someNumber, String actionName, String controllerName, Object routeValues, Object htmlAttributes)
{
return helper.ActionLink(linkText, actionName, controllerName, routeValues, htmlAttributes);
}
}
Be sure to include the namespace in which your extension method is defined.
E.g: