#if defined( DEBUG) in C# - use [Conditional("DEBUG")]
System.Diagnostics.Debug uses [Conditional("DEBUG")].
ILDASM.EXE shows that no code is generated.
Copy this code and paste it in your HTML
[Conditional("DEBUG")]
private static void debugtest()
{
...
}