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 inclu
To me the most elegant solution would be to simply define a field in code-behind with preprocessor directives and then check for its value from the aspx page.
In code-behind:
public partial class WebClient : System.Web.UI.Page
{
#if DEBUG
public bool DebugMode = true;
#else
public bool DebugMode = false;
#endif
}
Aspx page:
<%if(this.DebugMode){%>
<%}%>
<%else{%>
<%}%>