Pass multiple values to JS function and back to c#

Zam

New Member
User clicks button, button loads JQuery Dialog box, User clicks 'delete' and 2 values are passed to DeleteInvoice() on WorkItemMgr.cs\[code\] <input id="RemoveInvoice" type="button" value="http://stackoverflow.com/questions/15664869/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"); } } }); }\[/code\]I have went through it with a breakpoint and the 2 correct values are being passed but getting an error with the `WorkItemMgr.DeleteInvoice(InvoiceId, SiteIdentifier);Error: JavaScript runtime error: Object doesn't support property or method 'DeleteInvoice'DeleteInvoice is a webmethod...\[code\][WebMethod]protected string DeleteInvoice(int InvoiceId, int SiteIdentifier){\[/code\]
 
Back
Top