I have a page X.cshtml with the following code:
@helper CodeTest{
<h1>Test</h1>
}
And on my page Y.cshtml like to use this helper ... how can I call him?
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()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With