$('.del').click(function (event) { var parentID = { "CategoryID": $(this).closest('li').attr('id') }; parentID = JSON.stringify(parentID); alert('before ajax calling'); $.ajax({ type: "POST", url: "MasterService.asmx/RemoveCategory", data: parentID, contentType: "application/json; charset=utf-8", dataType: "json", success: function (msg) { alert('hurray! Success. ' + msg.d); $(this).closest('li').remove(); }, failure: function (response) { alert(response.d); } }); });
[WebMethod] public string RemoveCategory(string CategoryID) { CategoryMasterBAL categorymasterBAL = new CategoryMasterBAL(); return categorymasterBAL.RemoveCategory(CategoryID); }
[System.Web.Script.Services.ScriptService]
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)