D
Damien
I have a server control which is used on various ASP.NET pages.
Within this control, I would like to use ASP.NET AJAX PageMethods to
update data on the control. The problem is, the PageMethod wrapper
that is typically generated when the WebMethod is included on a Page
isn't being created when the WebMethod is in the control. Here's a
sample of the code...
C#:
[WebMethod]
public static string GetGreeting()
{
return "Hello World";
}
When the WebMethod is declared in the Page class, I can access this
using PageMethods.GetGreeting(...); from my JavaScript. Now that I've
moved the declaration to the Web Control, PageMethod.GetGreeting(...);
causes an error since it's not declared.
Is there any way to get this work? Seems like there should be, I
can't imagine that I have to declare the WebMethod within the Page
only.
Thanks in advance for your help.
-Damien
Within this control, I would like to use ASP.NET AJAX PageMethods to
update data on the control. The problem is, the PageMethod wrapper
that is typically generated when the WebMethod is included on a Page
isn't being created when the WebMethod is in the control. Here's a
sample of the code...
C#:
[WebMethod]
public static string GetGreeting()
{
return "Hello World";
}
When the WebMethod is declared in the Page class, I can access this
using PageMethods.GetGreeting(...); from my JavaScript. Now that I've
moved the declaration to the Web Control, PageMethod.GetGreeting(...);
causes an error since it's not declared.
Is there any way to get this work? Seems like there should be, I
can't imagine that I have to declare the WebMethod within the Page
only.
Thanks in advance for your help.
-Damien