Okay, I have just begun trying to use this thing, and have been trying
to get the simple "GetServerTime" example to work.

(By the way, if someone has a more step-by-step example of how to set
up and run AjaxPro than what is available on the web page, it would be
nice.)

Anyway, I'm using Visual Studio .NET 2003, .NET Framework 1.1

I've created a new C# Web Application, and added a reference to AjaxPro
to it.

I have a WebForm1.aspx file that looks like this:

-------
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs"
AutoEventWireup="false" Inherits="MyDemo.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
        <head>
                <title>WebForm1</title>
                <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 
7.1">
                <meta name="CODE_LANGUAGE" Content="C#">
                <meta name="vs_defaultClientScript" content="JavaScript">
                <meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5";>
                <script language="javascript" src="WebForm1.js"></script>
        </head>
        <body MS_POSITIONING="GridLayout" onload="getServerTime();">
                <form id="Form1" method="post" runat="server">
                </form>
        </body>
</html>
-------

I have a WebForm1.aspx.cs file that looks like this:

-------
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace MyDemo
{
        /// <summary>
        /// Summary description for WebForm1.
        /// </summary>
        public class WebForm1 : System.Web.UI.Page
        {
                protected void Page_Load(object sender, EventArgs e)
                {
                        
AjaxPro.Utility.RegisterTypeForAjax(typeof(MyDemo.WebForm1));
                }

                [AjaxPro.AjaxMethod]
                public DateTime GetServerTime()
                {
                        return DateTime.Now;
                }

                #region Web Form Designer generated code
                override protected void OnInit(EventArgs e)
                {
                        //
                        // CODEGEN: This call is required by the ASP.NET Web 
Form Designer.
                        //
                        InitializeComponent();
                        base.OnInit(e);
                }

                /// <summary>
                /// Required method for Designer support - do not modify
                /// the contents of this method with the code editor.
                /// </summary>
                private void InitializeComponent()
                {
                        this.Load += new System.EventHandler(this.Page_Load);
                }
                #endregion
        }
}
-------

I have a Web.config file that looks like this:

-------
<?xml version="1.0" encoding="utf-8" ?>
<configuration>

  <system.web>
        <httpHandlers>
                <add verb="POST,GET" path="ajaxpro/*ashx"
type="AjaxPro.AjaxHandlerFactory, AjaxPro"/>
        </httpHandlers>

    <!--  DYNAMIC DEBUG COMPILATION
          Set compilation debug="true" to enable ASPX debugging.
Otherwise, setting this value to
          false will improve runtime performance of this application.
          Set compilation debug="true" to insert debugging symbols
(.pdb information)
          into the compiled page. Because this creates a larger file
that executes
          more slowly, you should set this value to true only when
debugging and to
          false at all other times. For more information, refer to the
documentation about
          debugging ASP.NET files.
    -->
    <compilation
         defaultLanguage="c#"
         debug="true"
    />

    <!--  CUSTOM ERROR MESSAGES
          Set customErrors mode="On" or "RemoteOnly" to enable custom
error messages, "Off" to disable.
          Add <error> tags for each of the errors you want to handle.

          "On" Always display custom (friendly) messages.
          "Off" Always display detailed ASP.NET error information.
          "RemoteOnly" Display custom (friendly) messages only to users
not running
           on the local Web server. This setting is recommended for
security purposes, so
           that you do not display application detail information to
remote clients.
    -->
    <customErrors
    mode="RemoteOnly"
    />

    <!--  AUTHENTICATION
          This section sets the authentication policies of the
application. Possible modes are "Windows",
          "Forms", "Passport" and "None"

          "None" No authentication is performed.
          "Windows" IIS performs authentication (Basic, Digest, or
Integrated Windows) according to
           its settings for the application. Anonymous access must be
disabled in IIS.
          "Forms" You provide a custom form (Web page) for users to
enter their credentials, and then
           you authenticate them in your application. A user credential
token is stored in a cookie.
          "Passport" Authentication is performed via a centralized
authentication service provided
           by Microsoft that offers a single logon and core profile
services for member sites.
    -->
    <authentication mode="Windows" />

        <!--  AUTHORIZATION
          This section sets the authorization policies of the
application. You can allow or deny access
          to application resources by user or role. Wildcards: "*" mean
everyone, "?" means anonymous
          (unauthenticated) users.
    -->

    <authorization>
        <allow users="*" /> <!-- Allow all users -->
            <!--  <allow     users="[comma separated list of users]"
                             roles="[comma separated list of roles]"/>
                  <deny      users="[comma separated list of users]"
                             roles="[comma separated list of roles]"/>
            -->
    </authorization>

    <!--  APPLICATION-LEVEL TRACE LOGGING
          Application-level tracing enables trace log output for every
page within an application.
          Set trace enabled="true" to enable application trace logging.
 If pageOutput="true", the
          trace information will be displayed at the bottom of each
page.  Otherwise, you can view the
          application trace log by browsing the "trace.axd" page from
your web application
          root.
    -->
    <trace
        enabled="false"
        requestLimit="10"
        pageOutput="false"
        traceMode="SortByTime"
                localOnly="true"
    />

    <!--  SESSION STATE SETTINGS
          By default ASP.NET uses cookies to identify which requests
belong to a particular session.
          If cookies are not available, a session can be tracked by
adding a session identifier to the URL.
          To disable cookies, set sessionState cookieless="true".
    -->
    <sessionState
            mode="InProc"
            stateConnectionString="tcpip=127.0.0.1:42424"
            sqlConnectionString="data
source=127.0.0.1;Trusted_Connection=yes"
            cookieless="false"
            timeout="20"
    />

    <!--  GLOBALIZATION
          This section sets the globalization settings of the
application.
    -->
    <globalization
            requestEncoding="utf-8"
            responseEncoding="utf-8"
   />

 </system.web>

</configuration>
-------

And I have a WebForm1.js file that looks like this:

-------
function getServerTime()
{
  MyDemo.WebForm1.GetServerTime(getServerTime_callback);  //
asynchronous call
}

// This method will be called after the method has been executed
// and the result has been sent to the client.

function getServerTime_callback(res)
{
  alert(res.value);
}
-------

When I run the web page in IE (at
http://localhost/MyDemo/WebForm1.aspx) on my machine, it loads with the
following JavaScript error:

-------
Line: 4
Char: 3
Error: 'MyDemo' is undefined
Code: 0
URL: http://localhost/MyDemo/WebFrom1.aspx
-------

If I View Source on the page that is generated in the browser, I see
this:

-------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
        <head>
                <title>WebForm1</title>
                <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 
7.1">
                <meta name="CODE_LANGUAGE" Content="C#">
                <meta name="vs_defaultClientScript" content="JavaScript">
                <meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5";>
                <script language="javascript" src="WebForm1.js"></script>
        </head>
        <body MS_POSITIONING="GridLayout" onload="getServerTime();">
                <form name="Form1" method="post" action="WebForm1.aspx" 
id="Form1">
<input type="hidden" name="__VIEWSTATE"
value="dDwtNjU0MzcyMTk1Ozs+LRnX+0ZFY9n02Hh8L2v1AYyW38w=" />

<script type="text/javascript"
src="/MyDemo/ajaxpro/prototype.ashx"></script>
<script type="text/javascript"
src="/MyDemo/ajaxpro/core.ashx"></script>
<script type="text/javascript"
src="/MyDemo/ajaxpro/converter.ashx"></script>
<script type="text/javascript"
src="/MyDemo/ajaxpro/MyDemo.WebForm1,MyDemo.ashx"></script>



                </form>
        </body>
</html>
-------

The only thing that I can figure is that the files pointed to by the
first three JavaScript includes aren't actually there...although I
haven't seen anywhere on any of the "Quick Start" guides associated
with AjaxPro that talks about setting these up, and none of the
downloads I've downloaded (6.7.11.1_DLL, AjaxPro.6.2.16.1,
AjaxProStarterKit-1076) seem to include those files.

So...I suspect that my problem has something to do with something I
missed while setting it up, but there doesn't seem to be a sufficiently
detailed set-up guide so I can tell if that's the case or not.

Any help?

Cheers,
Joe


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

To post to this group, send email to ajaxpro@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to