si, non ho provato ma l'ho visto funzionare.
codice:
<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>

https://stackoverflow.com/questions/...asp-net-markup