EnablePageMethods
actually only interacts with methods of a Page
subclass that are public
, static
, and attributed as a WebMethod
.
GetCompanyList
has 2 of those and just also needs to be static
.
[System.Web.Services.WebMethod()]
[System.Web.Script.Services.ScriptMethod()]
public static IEnumerable<CompanyMinimum> GetCompanyList(int officeId) {
// ...
}
And, I suspect what's happening is that it's leaving PageMethods
undefined client-side if it doesn't find any methods that have all 3.