I saw this syntax:
@helper IncludeJS(string url)
{
<script src="@url" type="text/javascript"></script>
}
Placed on a .cshtml
file on Views\Helpers
. But then it is not recognized on views when using either:
Html.IncludeJS("")
IncludeJS("")
And I get this error:
CS1061: 'System.Web.Mvc.HtmlHelper<dynamic>' does not contain a definition for...
How can I create a custom HtmlHelper extension and use it on MVC3 (Razor)?