WebMethod not accessible in Sitecore
问题 I got a problem for a website I was working on. A WebMethod is called from a JavaScript function: var ajaxOptions = { url: "/layouts/foobar/Foo.aspx/GetBar" } $.ajax(ajaxOptions).done(function(result) { loadResult(result, a); }); The method GetBar in Foo.Aspx looks like this: [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public static object GetBar() { return FoobarManager.GetItems(); } The function returns a valid JSON object. Sitecore is used in the FoobarManager. Example