i using
$.getjson(uri).done(function(data){...} to array of data table in database.
within js function, letting user delete items array "data".
how can make these changes show on database?
i have c# function delete record given id parameter.
if use asp.net mvc can use method in controller or in api controller.
controller method:
[httpget] public actionresult delete(int id) { //your code if(result==true){ return content("true"); }else{ return content("false"); } } and jquery:
_jq.ajax({ url: 'http://example.com/id=?someid', type: "get", success: function (data, textstatus) { if(data=='true'){ alert('ok'); }else{ alert('false'); } }, error: function (textstatus, errorthrown) { alert('error') } });
Comments
Post a Comment