Ajax call back falling before going into the webmethod function

Mr. C

New Member
Here is my Ajax call :\[code\] $.ajax({ type: "POST", url: "ProductDetail.aspx/AddCart", data: '{productId:' + 4 + ',productTypeId:' + 0 + ',quantity:' + 1 + '}', contentType: "application/json; charset=utf-8", dataType: "json", success: function () { alert('successful'); refreshCart(); }, complete: function () { alert('Completed'); refreshCart(); } });\[/code\]It give alert('Completed') and then going to the webmethod function but I need it after my server side code completed. Do you have any suggestion?
 
Back
Top