473,394 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

issue when converting from Atlas to AJAX 1.0

I'm having trouble with the sample below since moving from Atlas to AJAX.
I've done a LOT of research with prototypes and delegates, but I cant get
this simple, "class-like" example to work.
Any help greatly appreciated. Thanks in advance.

============ASPX PAGE=============

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="test.aspx.vb"
Inherits="WebApplication1.test" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager runat="server" ID="ScriptManager1">
<Services>
<asp:ServiceReference Path="WS1.asmx" />
</Services>
</asp:ScriptManager>
<input type='button' value='Click me' id='myButton'
onclick='doThis(778899)' />
</form>
</body>
</html>

<script type="text/javascript">

function doThis( MyNumber ){

var tmpOjb = new MySampleClass( MyNumber );
tmpOjb._StartMyFunction();
tmpOjb = null;

}
MySampleClass = function( MyNumber )
{
this._MyNumber = MyNumber;

this._StartMyFunction = function()
{
// This WORKS, but with asyncronous call, this._MyNumber is lost
when _MyReturnHandler is run
/* */
WebApplication1.WS1.HelloWorld(
this._MyNumber,
this._MyReturnHandler);
/* */

// This DOES NOT WORK anymore, but DID with Atlas..
// How can I get this to work again??
/*
WebApplication1.WS1.HelloWorld(
this._MyNumber,
{onMethodComplete: Function.createDelegate(this,
this._MyReturnHandler)});
*/
}

this._MyReturnHandler = function(result)
{
alert(result + "::::" + this._MyNumber);
}
};

</script>


============ASMX PAGE=============
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Text
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.ComponentModel

<System.Web.Services.WebService(Namespace:="http ://tempuri.org/")_
<System.Web.Services.WebServiceBinding(ConformsTo: =WsiProfiles.BasicProfile1_1)>
_
<System.Web.Script.Services.ScriptService()_
<ToolboxItem(False)_
Public Class WS1
Inherits System.Web.Services.WebService

<WebMethod()_
Public Function HelloWorld(ByVal myNumber As String) As String
Return "Hello World [" & myNumber & "]"
End Function

End Class

Feb 11 '07 #1
0 1002

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Kevin Spencer | last post by:
Interesting article, with some good links: http://www.eggheadcafe.com/articles/20050709.asp -- HTH, Kevin Spencer Microsoft MVP ..Net Developer
8
by: darrel | last post by:
I'm going to be diving into ASP.net 2.0 on a small project. I'd also like to use it as an excuse to start playing with some AJAX techniques. So, that leads to the obvious question: AJAX.net vs....
5
by: Papanii Okai | last post by:
Hi Guys, As we wall know Atlas is a fairly new feature everyone is talking about (atleast at my school). Even though the idea of Ajax has been used in the past i was wondeing if anyone could...
5
by: geekboy0001 | last post by:
Just trying to get some opinions out there... There are tons of Ajax libraries out there... Ajax.NET Professional, ComfortASP.NET, ZumiPage, etc. etc... Microsoft has their own too, Atlas. I've...
2
by: A.Wussow | last post by:
Hi Everybody, i want to load dynamically content from some user controls (with forms, or some data-controls) using atlas. So i use an UpdatePanel for loading the user control into a placeholder....
1
by: MPA | last post by:
Hi, I am a newbee to web applications and we are planning to rewrite our existing PowerBuilder client-server application into a web application under Visual Studio .Net 2005. My question is...
4
by: s.bussing | last post by:
Hi All, I'm new to Atlas and I did some programming using AJAX, but I'm wondering if it is possible to hava a javascript which can call a server-site function, in my case to write data to the...
4
by: Olav | last post by:
Where can I find some ATLAS / Ajax newsgroups? Olav
4
by: Bob | last post by:
Hi, i want to use ajax in my application, but i saw there are a lot of possibilities. What to choose among clientcallback, atlas or ajax.net (anthem, magicajax) ? It seems that ajax.net is easy...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.