473,616 Members | 2,800 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need Ajax Help: Targeting Specific Methods

Hi.

I have an ajax question.
I am wondering if it is possible to get the response from a method
within a given page, and that function alone? Traditionally, I have
been getting the response from the Page_Load method of the targeted
page, but now I want the response from a particular method on the
target page:

Public Sub SomeCallback(By Val sender As Object, ByVal e As EventArgs)

'RETURN XML FOR CALLBACK

End Sub

Could somebody tell me how to focus on the resonse of a given method
inside a page? Thanks.

Mar 12 '07 #1
4 1351
On Mar 12, 9:55 am, "pbd22" <dush...@gmail. comwrote:
Hi.

I have an ajax question.
I am wondering if it is possible to get the response from a method
within a given page, and that function alone? Traditionally, I have
been getting the response from the Page_Load method of the targeted
page, but now I want the response from a particular method on the
target page:

Public Sub SomeCallback(By Val sender As Object, ByVal e As EventArgs)

'RETURN XML FOR CALLBACK

End Sub

Could somebody tell me how to focus on the resonse of a given method
inside a page? Thanks.
Events are fired by DOM elements (e.g. load event when the document
has finished loading), javscript functions don't have any such
concept.

If you want something to happen when a function is called, either have
the function call the method or wrap the function in some other method
and call your "event" function straight after the one you want to
watch.
--
Rob

Mar 12 '07 #2
On Mar 11, 9:13 pm, "RobG" <r...@iinet.net .auwrote:
On Mar 12, 9:55 am, "pbd22" <dush...@gmail. comwrote:
Hi.
I have an ajax question.
I am wondering if it is possible to get the response from a method
within a given page, and that function alone? Traditionally, I have
been getting the response from the Page_Load method of the targeted
page, but now I want the response from a particular method on the
target page:
Public Sub SomeCallback(By Val sender As Object, ByVal e As EventArgs)
'RETURN XML FOR CALLBACK
End Sub
Could somebody tell me how to focus on the resonse of a given method
inside a page? Thanks.

Events are fired by DOM elements (e.g. load event when the document
has finished loading), javscript functions don't have any such
concept.

If you want something to happen when a function is called, either have
the function call the method or wrap the function in some other method
and call your "event" function straight after the one you want to
watch.

--
Rob

Thanks.

Maybe I misunderstand what you are saying, but, I still don't
understand how to call a server method from the client-side
ajax call. would you mind showing me how to solve this problem? For
example, for the below ajax call, I am getting the response from the
Server.aspx pages's Page_Load method. But, how would I design the
below function to get the response from the server's SomeCallback
method?

function startRequest() {
if (window.XMLHttp Request) {
req = new XMLHttpRequest( );
} else if (window.ActiveX Object) {
isIE = true;
req = new ActiveXObject(" Microsoft.XMLHT TP");
}
req.open("GET", "server.asp x", true);
}

Mar 12 '07 #3
On Mar 12, 5:18 pm, "pbd22" <dush...@gmail. comwrote:
On Mar 11, 9:13 pm, "RobG" <r...@iinet.net .auwrote:
On Mar 12, 9:55 am, "pbd22" <dush...@gmail. comwrote:
Hi.
I have an ajax question.
I am wondering if it is possible to get the response from a method
within a given page, and that function alone? Traditionally, I have
been getting the response from the Page_Load method of the targeted
page, but now I want the response from a particular method on the
target page:
Public Sub SomeCallback(By Val sender As Object, ByVal e As EventArgs)
'RETURN XML FOR CALLBACK
End Sub
Could somebody tell me how to focus on the resonse of a given method
inside a page? Thanks.
Events are fired by DOM elements (e.g. load event when the document
has finished loading), javscript functions don't have any such
concept.
If you want something to happen when a function is called, either have
the function call the method or wrap the function in some other method
and call your "event" function straight after the one you want to
watch.
--
Rob

Thanks.

Maybe I misunderstand what you are saying, but, I still don't
understand how to call a server method from the client-side
ajax call. would you mind showing me how to solve this problem? For
example, for the below ajax call, I am getting the response from the
Server.aspx pages's Page_Load method. But, how would I design the
below function to get the response from the server's SomeCallback
method?

function startRequest() {
if (window.XMLHttp Request) {
req = new XMLHttpRequest( );
} else if (window.ActiveX Object) {
isIE = true;
req = new ActiveXObject(" Microsoft.XMLHT TP");
}
req.open("GET", "server.asp x", true);

}
Provide the script with a url parameter inside your ajax request, and
the script should call the proper method depending on this parameter.
You can't interfere with the work of your server script from inside
JavaScript. To ajax, i.e. to http protocol, all you're requesting is
the result of a program. What that program does is irrelevant for it,
as long as it gets the proper result. However, you can provide it with
parameters based upon which the server script can decide what methods
it's going to call.

Mar 12 '07 #4
On Mar 12, 10:36 am, "Darko" <darko.maksimo. ..@gmail.comwro te:
On Mar 12, 5:18 pm, "pbd22" <dush...@gmail. comwrote:
On Mar 11, 9:13 pm, "RobG" <r...@iinet.net .auwrote:
On Mar 12, 9:55 am, "pbd22" <dush...@gmail. comwrote:
Hi.
I have an ajax question.
I am wondering if it is possible to get the response from a method
within a given page, and that function alone? Traditionally, I have
been getting the response from the Page_Load method of the targeted
page, but now I want the response from a particular method on the
target page:
Public Sub SomeCallback(By Val sender As Object, ByVal e As EventArgs)
'RETURN XML FOR CALLBACK
End Sub
Could somebody tell me how to focus on the resonse of a given method
inside a page? Thanks.
Events are fired by DOM elements (e.g. load event when the document
has finished loading), javscript functions don't have any such
concept.
If you want something to happen when a function is called, either have
the function call the method or wrap the function in some other method
and call your "event" function straight after the one you want to
watch.
--
Rob
Thanks.
Maybe I misunderstand what you are saying, but, I still don't
understand how to call a server method from the client-side
ajax call. would you mind showing me how to solve this problem? For
example, for the below ajax call, I am getting the response from the
Server.aspx pages's Page_Load method. But, how would I design the
below function to get the response from the server's SomeCallback
method?
function startRequest() {
if (window.XMLHttp Request) {
req = new XMLHttpRequest( );
} else if (window.ActiveX Object) {
isIE = true;
req = new ActiveXObject(" Microsoft.XMLHT TP");
}
req.open("GET", "server.asp x", true);
}

Provide the script with a url parameter inside your ajax request, and
the script should call the proper method depending on this parameter.
You can't interfere with the work of your server script from inside
JavaScript. To ajax, i.e. to http protocol, all you're requesting is
the result of a program. What that program does is irrelevant for it,
as long as it gets the proper result. However, you can provide it with
parameters based upon which the server script can decide what methods
it's going to call.

Thanks Darko (and Rob),

I think I understand. Not sure tho.

So, are you saying that if I include a parameter in the xmlhttp
request that points to the server-side method I will be able to target
that method's response? For example:

req.open("GET", "server.aspx?st artMethod=SomeC allback", true);

This doesn't look right. Would somebody mind showing me a code example
of how to do this (your own code or a link)? Sorry, I just want to
make sure I understand this.

Thanks.

Mar 13 '07 #5

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

Similar topics

0
3429
by: abcd | last post by:
kutthaense Secretary Djetvedehald H. Rumsfeld legai predicted eventual vicmadhlary in Iraq mariyu Afghmadhlaistmadhla, kaani jetvedehly after "a ljetvedehg, hard slog," mariyu vede legai pressed Pentagjetvedeh karuvificials madhla reachathe strategy in karkun campaign deshatinst terrorism. "mudivae maretu winning or losing karkun global varti jetvedeh terror?" Mr. Rumsfeld adugued in a recent memormariyuum. vede velli jetvedeh madhla...
10
4422
by: sheadley | last post by:
Hi all, When using AJAX and javascript I get the following error when talking to my server: A script from http://www.mydomain.com was denied UniversalBrowserRead privileges. I am using firefox 1.5 and here is the code that is being called: function showConsumptionData(foodType) { var url =
10
4401
by: celoftis | last post by:
Using VS 2005: This morning, following the instructions here: http://ajax.asp.net/docs/overview/InstallingASPNETAJAX.aspx, I installed ASP.NET AJAX on my WinXP Pro development machine. Following that, I installed the "November 2006 CTP" and "Control Toolkit" - then I re-booted my machine. Next I tried to create a simple, sample page... I have the AJAX controls in my toolbox, but when I drag on onto my page it gets underlined - denoting...
4
8730
by: Grant Merwitz | last post by:
Hi I am trying to implement the Microsoft Ajax.NET extensions to perform a lookup on a key press of a text box. What this will do is once a user enters a letter into the textbox, this will filter a list from a database and populate some filtered options for the user to choose in a seperate listbox. Any subsequent key presses will further filter this result set.
1
2028
by: jborg | last post by:
I have a method to send PHP array values via Ajax to another PHP file that processes my request, however I cannot get it to work here. I know this is normally a basic and very general error, but I cannot figure out how I am getting it. I am trying to program a specific event calendar, the issue is on one of the events. I am trying to allow users to rate other users that went to the event. The below code lists the users, and attempts to...
1
2008
by: bizt | last post by:
Hi, I am having my first real attempt at an ajax class as so far Ive managed to build one that, once instatiated, will allow me to define which function it will call on completion then retrieves the contents from a server side script as AJAX generally does and process it using that function. This far Im quite pleased with it, however, I really want something that will allow me to perform multiple AJAX calls from the same script. I...
6
1602
by: Scott M. | last post by:
What is the version number of AJAX when we talk about ASP .NET AJAX in VS 2008?
2
1854
by: Johnson | last post by:
While I have done a substantial amount of ASP.NET programming, I have only dabbled with AJAX (update panels and a 3rd party JSON setup - jayrock - that directly updates the DOM). In any case, I'm considering offering Web pages both to browsers that support AJAX and to those that do not support AJAX. Questions: 1. In general, should I look to offer two versions of each page - one for AJAX clients and the other for "non AJAX-supporting"...
0
8642
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8294
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8448
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6097
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5550
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4060
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4140
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2576
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.