0

Many MVC extensions use their own variable for the HtmlHelper on the view page, like you would mark up a Telerik helper as @Telerik().Helper. My extension is still stuck on the ol' HtmlHelper<TModel>, so I can't say @Erisia().Helper and have to resort to plain old, non-promotional, @Html.MyHelper.

How can I achieve this trick like other extension libraries?

ProfK
  • 49,207
  • 121
  • 399
  • 775
  • The end result is that I wanted to e.g. use '@Erisia.ListHelper', like I recalled DevExpress using '@DevExpress.ListHelper', but they use '@Html.DevExpress().ListHelper', so my question is totally off the mark. Let's close this one down quickly. – ProfK Mar 13 '13 at 06:04

1 Answers1

1

You can just make your own static class for this

public static class Test
{
    public static string Helper()
    {
        return "helper!";
    }
}

And then in your view @Test.Helper

See this question if you need to inherit from HtmlHelper for some reason.

Community
  • 1
  • 1
colinwd
  • 77
  • 8