<pre> using System.Web.Services; using System.Web.Script.Services; public class Container { public int Name { get; set; } public int Size {get;set;} [WebMethod()] [ScriptMethod()] public static bool Exists(string ContainerName) { // Check stuff here and return true or false; return true; } }
$(document).ready(function () { $('#testModel').click(function (e) { // alert("calling web service now"); $.ajax({ url: 'Models/Container/Exists', method: 'post', contentType: 'application/json; charset=utf-8;', data: '{ "ContainerName": "xxxx" }', success: function (r) { alert(r.d); }, error: function (err) { alert(err.status + "\nScriptCall Failed"); } }); }); });
Models/Container
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)