#DEBUG Preprocessor statements in ASPX page

asp.net, c#, c-preprocessor

Solution

Interesting difference here - using #if DEBUG in the aspx page pulls from the tag in the web.config, but when you use it in the code-behind, it pulls DEBUG from the constant from the build configuration in the project file. So they're actually accessing two different settings.

Thus, as far as I can tell, this isn't actually possible.

Problem

I'm trying to use a preprocessor directive in an ASPX page, but the page doesn't recognize it. Is this just something I can't do? Background: I'm trying to include the full version of jQuery in DEBUG mode (for, well, debugging =) ), and the minified version for release. I tried this, but I'm not terribly familiar with the ASPX <% syntax. Am I just fundamentally misunderstanding what this syntax does? ``` <% #if DEBUG %> <script type="text/javascript" src="resources/jquery-1.3.2.js" /> <% #else %> <script type="text/javascript" src="resources/jquery-1.3.2.min.js" /> <% #endif %> ```

Original source