Hi,

the problem is that you are missing the <form> tag, the second thing
is that you try to call a AjaxPro method directly in the HTML page.
You have to be sure that everything is loaded (like you have to do
with other frameworks or JavaScript libs, too). Change the HTML file
like below:



<%@ Page Language="c#" CodeFile="test.aspx.cs" Inherits="MyDemo.test"
%>
<%@ import Namespace="MyDemo" %>
<html>
<head>
   <title>Untitled Page</title>
   <script type="text/javascript">
               function getServerTime()
               {
                 MyDemo.test.GetServerTime(getServerTime_Callback);  /
               }

               function getServerTime_callback(res)
               {
                 alert(res.value);
               }
   </script>
</head>
<body>
       <form id="form1" runat="server"></form>
       <script type="text/javascript">
              setTimeout(getServerTime, 1);
       </script>
</body>
</html>



You will see in the HTML output that there are some JavaScript
includes added between the form tags.

Regards,
Michael










On 9/24/06, ns1045 <[EMAIL PROTECTED]> wrote:
>
> Here the reworked code. But it is still the same. "MyDemo is unknown"
> Regards,
> Jens
>
> ---------------------------------------------------------------------------------------------
> test.aspx.cs:
>
> using System;
>
> namespace MyDemo
> {
>  public partial class test : System.Web.UI.Page
>  {
>        void Page_Load(object sender, EventArgs e)
>    {
>      AjaxPro.Utility.RegisterTypeForAjax(typeof(MyDemo.test));
>    }
>
>    [AjaxPro.AjaxMethod]
>    public static DateTime GetServerTime()
>    {
>      return DateTime.Now;
>    }
>  }
>
> }
>
> -------------------------------------------------------------------
>
> test.aspx:
>
> <%@ Page Language="c#" CodeFile="test.aspx.cs" Inherits="MyDemo.test"
> %>
> <%@ import Namespace="MyDemo" %>
> <html>
> <head>
>    <title>Untitled Page</title>
>    <script type="text/javascript">
>                function getServerTime()
>                {
>                  MyDemo.test.GetServerTime(getServerTime_Callback);  /
>                }
>
>                function getServerTime_callback(res)
>                {
>                  alert(res.value);
>                }
>    </script>
> </head>
> <body>
>        <script type="text/javascript">
>               getServerTime();
>        </script>
> </body>
> </html>
>
> -------------------------------------------------------------------
>
> web.config:
>
> <?xml version="1.0" encoding="UTF-8" ?>
>
> <configuration>
>
>        <system.web>
>                <httpHandlers>
>      <add verb="POST,GET" path="ajaxpro/*.ashx"
> type="AjaxPro.AjaxHandlerFactory, AjaxPro.2"/>
>    </httpHandlers>
>                <compilation defaultLanguage="c#" debug="true">
>
>                </compilation>
>
>        <customErrors mode="Off"/>
>        </system.web>
> </configuration>
>
>
> >
>


-- 
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