用户单击按钮,按钮加载 JQuery 对话框,用户单击“删除”并将 2 个值传递给 WorkItemMgr.cs 上的 DeleteInvoice()
<input id="RemoveInvoice" type="button" value="Remove Invoice" onclick="ConfirmDeleteInvoice('<%:TempInvoiceId%>', '<%:InvoiceId %>')" />
$("#RemoveInvoice").click(ConfirmDeleteInvoice);
function ConfirmDeleteInvoice(InvoiceId, SiteIdentifier) {
$("#dialog-confirm").dialog({
resizable: false,
height: 180,
modal: true,
buttons: {
Delete: function () {
WorkItemMgr.DeleteInvoice(InvoiceId, SiteIdentifier);
$(this).dialog("close");
},
Cancel: function () {
$(this).dialog("close");
}
}
});
}
我已经通过断点完成了它,并且正在传递 2 个正确的值,但是 `WorkItemMgr.DeleteInvoice(InvoiceId, SiteIdentifier); 出现错误
错误:JavaScript 运行时错误:对象不支持属性或方法“DeleteInvoice”
DeleteInvoice 是一种网络方法...
[WebMethod]
protected string DeleteInvoice(int InvoiceId, int SiteIdentifier)
{