Hi,

I prefer to put the AjaxMethods in a seperate class and use only
static methods. The problem is that the page is not yet compiled when
writing your code.

public class AjaxMethods
{
    [AjaxMethod]
    public static string SayHell(string name)
    {
        return "Hello " + name;
    }
}


This class save in \App_Code and you are happy. Don't use the
AjaxMethod in the same class as the Page.

Regards,
Michael



On 9/28/06, jrnail23 <[EMAIL PROTECTED]> wrote:
>
> I'm trying to call an AJAX method from one page from another page, but
> I can't seem to get the AjaxPro.Utility.RegisterTypeForAjax method to
> work properly.
>
> The page I'm loading is Go_Scan (//Go/Scan.aspx)
>
> When I register that type within the page like this, everything is
> fine:
> AjaxPro.Utility.RegisterTypeForAjax(GetType(Go_Scan))
>
> Then, from the Scan.aspx page, I want to call an AJAX method located in
> another page (//Go/Ping.aspx), so I use the RegisterTypeForAjax method
> in Go_Scan's Page_Load event, like this:
> AjaxPro.Utility.RegisterTypeForAjax(GetType(Go_Ping))
>
> With this, my code won't compile, and I can't seem to figure out how to
> get it to work.  I'm sure there's another way to reference the
> Ping.aspx page, but I don't know how... can someone help me with this?
>
>
> >
>


-- 
Best regards | Schöne Grüße
Michael

Microsoft MVP - Most Valuable Professional
Microsoft MCAD - Certified Application Developer

http://weblogs.asp.net/mschwarz/
http://www.schwarz-interactive.de/

Skype: callto:schwarz-interactive
MSN IM: [EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Ajax.NET Professional" group.

To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]

For more options, visit this group at http://groups.google.com/group/ajaxpro

The latest downloads of Ajax.NET Professional can be found at 
http://www.ajaxpro.info/

Don't forget to read my blog at http://weblogs.asp.net/mschwarz/
-~----------~----~----~----~------~----~------~--~---

Reply via email to