473,288 Members | 1,743 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,288 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 3808
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.