Is there an #IF DEBUG for Asp.net markup?

<form runat="server">
 <% #if DEBUG %>
 <asp:TextBox ID="TextBox1" runat="server">You're in debug mode</asp:TextBox>
 <% #else %>
 <asp:TextBox ID="TextBox2" runat="server">Mmm... No, I think you're not in debug mode</asp:TextBox>
 <% #endif %>
</form>

Note that you cannot assign the same ID for those text boxes.

Also note that DEBUG is true when it is set so in web.config:

<compilation debug="true">

Leave a Comment