I wrote this function
<script type="text/javascript">
function saveDelivery() {
alert("tttt")
var model = @Html.Raw(Json.Encode(Model)); //errror
$.ajax({
type: 'POST',
url: '@Url.Action("SaveDelivery", "Business")',
contentType: 'application/json; charset=utf-8',
data: JSON.serialize(model),
success: function (result) {
},
error: function (xhr, ajaxOptions, thrownError) {
alert(xhr.status);
alert(thrownError);
}
});
}
but there is error on
var model = @Html.Raw(Json.Encode(Model));
it says conditional compilation is turned off
How to slove this?