public static bool IsDebug(this HtmlHelper htmlHelper) { #if DEBUG return true; #else return false; #endif }
Then on our view, we could call the method:
@if (Html.IsDebug()) { @Html.Raw("<span style='color: red'>DEBUGGING MODE IS ON</span>"); }
Welcome to my blog site... hope my notes can help your coding becomes more cheerful :)
public static bool IsDebug(this HtmlHelper htmlHelper) { #if DEBUG return true; #else return false; #endif }
@if (Html.IsDebug()) { @Html.Raw("<span style='color: red'>DEBUGGING MODE IS ON</span>"); }
No comments:
Post a Comment