我写了这个功能HTML条件编译在MVC C#关闭
<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);
}
});
}
但对
var model = @Html.Raw(Json.Encode(Model));
它说:conditional compilation is turned off
如何解决售后服务这个错误?
试试这个可能会工作吧 var model =“@ Html.Raw(Json.Encode(Model))”;; – Amit 2013-04-11 07:25:39