How to use Preprocessor directives in MVC aspx pages

Posted by Zuber on Stack Overflow See other posts from Stack Overflow or by Zuber
Published on 2010-04-13T09:06:13Z Indexed on 2010/04/13 9:13 UTC
Read the original article Hit count: 344

I am using MinifyJS.tt which is a T4 template to minify all my JS files automatically. In my aspx files, I am referencing all the javascript files.

Now, I want to add a condition (maybe compiler directive) to use the original JS file when I am debugging the application, and to use the minified JS files when I simply run the application without debug. I tried using #if in the aspx page, but that did not seem to work.

Can we make use of preprocessor directives in aspx pages? Is there an alternative way to achieve my goal?

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about c#