I want to do some preprocessing on my views before they are parsed by the Razor template engine. The only way I found so far is by extending the RazorTemplateEngine class and overriding the CreateParser method, where I can return a custom parser that does the preprocessing before calling the base parser.
Now my problem is – how can I make Razor use my custom template engine?
I don’t know if that will work for you but it should 🙂
try to add
in the head of your views.
for more information look at this page