I have some razor functions that needs to be shared between views.
On stackoverflow I saw that you need to create a razor view in the App_Code folder. But then you need to inject everything into your method.
If I place this in a new folder called Functions in my Views folder, then I can inherit everything I need but then I can't call these functions from within my other views.
Shared functions between views
Hi all,
I have some razor functions that needs to be shared between views. On stackoverflow I saw that you need to create a razor view in the
App_Code
folder. But then you need to inject everything into your method.If I place this in a new folder called
Functions
in myViews
folder, then I can inherit everything I need but then I can't call these functions from within my other views.Anyone that can help me out?
/Michaël
Do you have a example on what you are trying to do ?
Dave
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.