Using the sub page created on page X in Y?

I have an X.cshtml page with the following code:

@helper CodeTest{
    <h1>Test</h1>
}

And on my Y.cshtml page I like to use this helper ... how can I call him?

+5
source share
1 answer

Move the helper from X.cshtml to Z.cshtml, which you should put in App_Code. Then you can call it from anywhere in your application.

@Z.CodeTest()
+4
source

All Articles