I have tried several tactics to use the boolean value within the JS ,but nothing works :
<script type="text/javascript">
var model = @Html.Raw(Json.Encode(Model));
if (model.IsNew == true) {
alert("1");
}
</script>
Tried the following:
var IsNew = @Model.IsNew ;
var IsNew = "@Model.IsNew";
I keep getting the following error :
Conditional compilation is turned off
Anyone could explain why this occurs and maybe guide me to a possible solution ?