Custom html helpers in MVC 4

后端 未结 2 1024
-上瘾入骨i
-上瘾入骨i 2021-01-01 19:53

I created the helper class

namespace SEM.API.Helpers
{
    public static class Navigation
    {
        public static string BuildSomething(this HtmlHelper h         


        
2条回答
  •  旧巷少年郎
    2021-01-01 20:17

    and added namespace to webconfig

    Make sure you did this in ~/Views/web.config and not in ~/web.config.

    Another thing to try is to add the @using directive to your view:

    @using SEM.API.Helpers
    @Html.BuildSomething()
    

提交回复
热议问题