Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [ServiceContract]
- public interface IService
- {
- [OperationContract]
- [WebInvoke(Method = "POST")]
- void Delete(int id);
- }
- public class Service : IService
- {
- public void Delete(int id)
- {
- //I do Some Work
- }
- }
- $(function () {
- function successDel(data) {
- alert('done');
- }
- callService("MyserviceAddress/Delete", "POST", JSON.stringify({"id":"11"}), successDel, function errordel(xhr, status, error) {
- alert(error);
- }, "application/json; charset=utf-8", "json");
- })
- function callService(url, type, data, successFunc, errorFunc, contentType, dataType) {
- $.ajax({
- url: url,
- type: type,
- cache: false,
- proccessData: false,
- contentType: contentType,
- dataType:dataType,
- data: data,
- success: successFunc,
- error: errorFunc
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement