What works for me is to put my WebMethods in a custom class derived from System.Web.UI.Page
public class MyPage : System.Web.UI.Page { [WebMethod] public static bool MyMethod(string value) { return true; } }
Then, when I have a page containing user control that this WebMethod should use, I retrieve this page from my custom page class instead of System.Web.UI.Page.
source share