I’m trying to call a custom HtmlHelper’s extension method from a partial view
<%: Html.ToRelativeTime(Model.CreatedDate) %>
and I get this error:
CS1061: ...does not contain a definition for 'ToRelativeTime' and no extension method 'ToRelativeTime' accepting a first argument of type 'System.Web.Mvc.HtmlHelper...could be found (are you missing a using directive or an assembly reference?)
and I’m calling the render code as this:
<% Html.RenderPartial("Product", Model.Product); %>
P.S: When I type Html., there is no intellesince.
Try to add namespace reference of your extension to the partial view where you trying to use your custom extension
also here you may find a useful information