尝试在 IE 中删除产品时开始出现此错误。我已经修复了问题的第一部分,即 JSON 未定义,所以我 src'd 了一个 json2.js。但现在我收到了 SCRIPT5007 错误。将不胜感激一些帮助!
function ProductDelete(MenuboardProducts) {
$.ajax({
url: "ProductBooks.aspx/DeleteProduct",
type: "POST",
data: JSON.stringify({ MenuboardProduct: MenuboardProducts }),
dataType: "json",
contentType: 'application/json; charset=utf-8',
success: function(ret) {
if (ret.d) {
alert(ret.d);
$find("ctl00_ContentPlaceHolder1_RadAjaxPanel1").ajaxRequest();
}
}
});
}
错误 ::: SCRIPT5007: 属性“ProductDelete”的值为 null 或未定义,不是函数对象
这是后端代码:
OutID = Convert.ToInt32(drpOutletL.SelectedValue);
var serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
var js = serializer.Serialize(lstMenuboardProductsInUse);
ScriptManager.RegisterStartupScript(this, this.GetType(),
"Delete", "if(confirm('" + sb.ToString() + "')){ProductDelete(" + js + ");}", true);