473,396 Members | 1,799 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,396 software developers and data experts.

Passing multiple arguments to the client-side JavaScript function in AJAX

I am a beginner with AJAX, and have managed to learn how to use it when
passing single parameters, but I want to return more than one value to the
client-side JavaScript function that displays it. My client-side JavaScript
function takes 4 parameters (which are expected to be integers). The idea of
passing a single parameter and parsing it on the client has occurred to me,
but since I am sure I am not the only person who has situations that require
more than one parameter, I was hoping there would be an easier way. Any
ideas? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
Nov 20 '06 #1
4 3811
Hi,

Nathan Sokalski wrote:
I am a beginner with AJAX, and have managed to learn how to use it when
passing single parameters, but I want to return more than one value to the
client-side JavaScript function that displays it. My client-side JavaScript
function takes 4 parameters (which are expected to be integers). The idea of
passing a single parameter and parsing it on the client has occurred to me,
but since I am sure I am not the only person who has situations that require
more than one parameter, I was hoping there would be an easier way. Any
ideas? Thanks.
AJAX doesn't mean much. Do you use SOAP, or a simple ASHX custom
handler, or something else?

With SOAP, you can pass an object back to the JavaScript client. Note
that unless you use a library doing that for you (for example ASP.NET
AJAX formerly known as ATLAS), you must parse the result yourself.

If you use a custom handler, you can return XML in the response, and
then parse the received XML. Nothing prevents you then to define your
own XML format to pass any number of parameters to the script.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Nov 20 '06 #2
Sorry, I probably should have included more details. I am writing a custom
control for ASP.NET using VB.NET and want to include AJAX. I am using the
following for the AJAX:

I am using the ICallbackEventHandler interface by including the following
line:
Implements ICallbackEventHandler

This interface includes implementing the following method and function:
Public Sub RaiseCallbackEvent(ByVal eventArgument As String) Implements
ICallbackEventHandler.RaiseCallbackEvent
Public Function GetCallbackResult() As String Implements
ICallbackEventHandler.GetCallbackResult
Because ATLAS is still in Beta (at least the last time I checked), I did not
want to start using it yet. If I understand you correct, there is no simple
way to pass multiple parameters using only VB.NET and JavaScript? Thank you
for the information.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Laurent Bugnion" <ga*********@bluewin.chwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Hi,

Nathan Sokalski wrote:
>I am a beginner with AJAX, and have managed to learn how to use it when
passing single parameters, but I want to return more than one value to
the client-side JavaScript function that displays it. My client-side
JavaScript function takes 4 parameters (which are expected to be
integers). The idea of passing a single parameter and parsing it on the
client has occurred to me, but since I am sure I am not the only person
who has situations that require more than one parameter, I was hoping
there would be an easier way. Any ideas? Thanks.

AJAX doesn't mean much. Do you use SOAP, or a simple ASHX custom handler,
or something else?

With SOAP, you can pass an object back to the JavaScript client. Note that
unless you use a library doing that for you (for example ASP.NET AJAX
formerly known as ATLAS), you must parse the result yourself.

If you use a custom handler, you can return XML in the response, and then
parse the received XML. Nothing prevents you then to define your own XML
format to pass any number of parameters to the script.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch

Nov 20 '06 #3
Hi,

with Ajax.NET Professional (http://www.ajaxpro.info/) you can use multiple
parameters to call .NET methods. As return value you can use any type, i.e.
DataTable or arrays or your own structures/classes.

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

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

http://weblogs.asp.net/mschwarz/
http://www.ajaxpro.info/


"Nathan Sokalski" <nj********@hotmail.comschrieb im Newsbeitrag
news:Oj**************@TK2MSFTNGP02.phx.gbl...
Sorry, I probably should have included more details. I am writing a custom
control for ASP.NET using VB.NET and want to include AJAX. I am using the
following for the AJAX:

I am using the ICallbackEventHandler interface by including the following
line:
Implements ICallbackEventHandler

This interface includes implementing the following method and function:
Public Sub RaiseCallbackEvent(ByVal eventArgument As String) Implements
ICallbackEventHandler.RaiseCallbackEvent
Public Function GetCallbackResult() As String Implements
ICallbackEventHandler.GetCallbackResult
Because ATLAS is still in Beta (at least the last time I checked), I did
not want to start using it yet. If I understand you correct, there is no
simple way to pass multiple parameters using only VB.NET and JavaScript?
Thank you for the information.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Laurent Bugnion" <ga*********@bluewin.chwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>Hi,

Nathan Sokalski wrote:
>>I am a beginner with AJAX, and have managed to learn how to use it when
passing single parameters, but I want to return more than one value to
the client-side JavaScript function that displays it. My client-side
JavaScript function takes 4 parameters (which are expected to be
integers). The idea of passing a single parameter and parsing it on the
client has occurred to me, but since I am sure I am not the only person
who has situations that require more than one parameter, I was hoping
there would be an easier way. Any ideas? Thanks.

AJAX doesn't mean much. Do you use SOAP, or a simple ASHX custom handler,
or something else?

With SOAP, you can pass an object back to the JavaScript client. Note
that unless you use a library doing that for you (for example ASP.NET
AJAX formerly known as ATLAS), you must parse the result yourself.

If you use a custom handler, you can return XML in the response, and then
parse the received XML. Nothing prevents you then to define your own XML
format to pass any number of parameters to the script.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch


Nov 20 '06 #4
I've done what you are describing in my WebChat control.
The included source code and article should provice all you need:
http://SteveOrr.net/articles/WebChat.aspx

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:eK**************@TK2MSFTNGP06.phx.gbl...
>I am a beginner with AJAX, and have managed to learn how to use it when
passing single parameters, but I want to return more than one value to the
client-side JavaScript function that displays it. My client-side JavaScript
function takes 4 parameters (which are expected to be integers). The idea
of passing a single parameter and parsing it on the client has occurred to
me, but since I am sure I am not the only person who has situations that
require more than one parameter, I was hoping there would be an easier way.
Any ideas? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

Nov 20 '06 #5

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

Similar topics

0
by: Naveed Anwar Kharadi | last post by:
From: "Naveed Anwar Kharadi" <n-anwar@corrtec.com> Subject: Passing a Collection object to a COM+ Server application. Date: Thursday, May 20, 2004 12:43 PM Hi, I am trying to develop a COM+...
7
by: Harolds | last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005 the pmID is evaluated to "" instead of what the value is set to: .... xmlItems.Document = pmXML // Add the pmID...
2
by: pyrexia | last post by:
Greets all. I'm attempting to write an app that will be used as a 'control/launcher' application for other apps. For the sake of argument let's say the app is launched from a command line: ...
12
by: Noel | last post by:
Hello, I'm currently developing a web service that retrieves data from an employee table. I would like to send and retrieve a custom employee class to/from the webservice. I have currently coded...
60
by: Shawnk | last post by:
Some Sr. colleges and I have had an on going discussion relative to when and if C# will ever support 'true' multiple inheritance. Relevant to this, I wanted to query the C# community (the...
16
by: Theo R. | last post by:
Hi all, Does the C99 Standard explicitly mention the need for a stack for passing arguments or Is this platform specific? As an example, the ARM9 processor recommends Core Registers R0-R3 be...
1
by: Jean Paul Mertens | last post by:
Hello, Is there a simple way for passing arguments to applications deployed with ClickOnce and having off-line capabilities. My app takes arguments if I start it with the whole path to it...
5
by: goldtech | last post by:
Hi, I'm passing what I think is a string parameter to another Python program (spawn.py) - see the code snip below. But only the counter part gets printed to a log file via spawn.py. Yet the...
0
by: sashaxp | last post by:
Hi, Is it possible to pass client's certificate through multiple hops. Let me describe desirable scenario: some client (might be in any platform) that located outside domain attach...
2
by: Israel | last post by:
It seems like there should be a way to pass events around like delegates but on the other hand they’re sort of special delegates because the only one allowed to invoke them is the owner of the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.