Sometimes you want to run your code only when it is not in debug mode.
You can use #IF DEBUG code block for this purpose
#if DEBUG LogMail("It is in debug mode, only add a log record.") #else SendMail("It is not in debug mode, so you can send e-mail.") #endif
Creating Multiline textbox using Html.Helper function in Asp.Net MVC
Determine If string contains more than 1 value in C#
Using View Model to pass Multiple Models in Single View in MVC
Using Code Blocks, Mixing Text & C# Code and Comments in Asp.NET MVC Razor
Formatting a Nullable DateTime with ToString() in ASP.Net MVC