KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have the following jquery code to call a webmethod in an aspx page $.ajax({ type: "POST", url: "popup.aspx/GetJewellerAssets", contentType: "application/json; charset=utf-8", data: '{"jewellerId":' + filter + '}', dataType: "json", success: AjaxSucceeded, error: AjaxFailed }); and here is the web method signature [WebMethod] public static string GetJewellerAssets(int jewellerId) { This works fine. But now I need to get two parameters passed to the web method the new web method looks like this [WebMethod] public static string GetJewellerAssets(int jewellerId, string locale) { } How do I change the client code to successfully call this new method signature ? EDIT: The following 2 syntaxes worked data: '{ "jewellerId":' + filter + ', "locale":"en" }', and data: JSON.stringify({ jewellerId: filter, locale: locale }), where filter and locale are local variables
Tags (comma-separated)
Save Edits
Cancel