 <pre><code>[WebMethod] [ScriptMethod] public bool GetFarmersByName(string name) </code></pre> <p>this method must be public static method which return some data if you want to call it by ajax..</p> <p>like</p> <pre><code>[WebMethod] [ScriptMethod] public static bool GetFarmersByName(string name) </code></pre>