How create global function for use all views in ASP.NET MVC 5

25 views Asked by At

I am trying to migrate my old web app version to .NET 7, and now like App_Code in previous version, I want to call my helpers from all views.

I found this and write this below one partial view:

    @functions {
       public void MyHelper(SettingModel setting)
       {
         <div>.....</div>
       }
   }

it works, but just in same partial view.

I want to be able to call it from other views.

0

There are 0 answers