Line: 4
Char: 2
Error: "EmployerProfiles" is undefined
Code: 0
URL: http://[server]/employerprofiles/default.aspx
Anyone have an explanation? I tried surrounding my class with a namespace and then redefined my functions in the _javascript_ file with that namespace but the same error occurred.
Shandy
From: [EMAIL PROTECTED]
To: [email protected]
Subject: [ajaxpro] Yet another person trying to get the quick guide to work
Date: Tue, 18 Jul 2006 14:34:46 -0700
Ok, I have tried EVERYTHING that has been listed to make quick guide sample to work. I even downloaded Joseph Guadagno's VB project http://josephguadagno.net/ajax.aspx that he says is working fine and tried to run it but it didn't work.
The _javascript_ error i'm getting is:
Line: 19
Char: 1
Error: Object Expected
Code: 0
URL: http://[server]/employerprofiles/default.aspx
Its refering to this line of code in the default.aspx:
<button type="button">GetServerTime</button>
Here's all my stuff:
Just some quick side notes
- The folder employerprofiles is a subweb. So any paths that start at the root under this project are really starting at /employerprofiles/
- A reference was added to the project for the AjaxPro.dll (I'm using ASP.NET 1.1)
-----------------
/web.config
-----------------
[...]
<httpHandlers>
<!-- Register the ajax handler -->
<add verb="POST,GET" path="ajax/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro" />
</httpHandlers>
[...]
------------------
/default.aspx
------------------
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="default.aspx.vb" Inherits="EmployerProfiles.TestAJAX"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhmtl1-strict.dtd">
<HTML>
<HEAD>
<title>default</title>
<script language="_javascript_" src=""></script>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<button type="button">GetServerTime</button>
</form>
</body>
</HTML>
----------------------
/default.aspx.vb
----------------------
Public Class TestAJAX
Inherits System.Web.UI.Page
[Web Form Designer Generated Code]
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
AjaxPro.Utility.RegisterTypeForAjax(GetType(EmployerProfiles.TestAJAX))
End Sub
<AjaxPro.AjaxMethod()> _
Public Function GetServerTime() As String
Return DateTime.Now.ToString()
End Function
End Class
-------------------------------
/_javascript_/TestAjax.js
-------------------------------
function GetServerTime()
{
EmployerProfiles.TestAJAX.GetServerTime(GetServerTime_Callback)
}
function GetServerTime_Callback(response)
{
alert(response.value);
}
If anyone can tell me at all what is wrong and how to fix it they will be in my hall of coding fame forever :) Thanks!
Shandy
Be one of the first to try Windows Live Mail beta
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
