Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all i have a code like this,

PageA:
http.open("GET","PageB.aspx/fncall",true);
http.send();

PageB:
Public string fncall()
{
return "Hello All It Worked for me..!!!";
}

Iam unable to get value from particular function but if i code like this,

PageA:
http.open("GET","PageB.aspx",true);
http.send();

PageB:
public void fncall()
{
response.write("Hello All it worked for me");
}

its working.But i need to get value from particular function without depending on page load event. how to do it?
Thanks in Advance...
Posted
Updated 17-Nov-15 19:17pm
v2
Comments
Amit Jadli 18-Nov-15 0:56am    
You can use jquery ajax methods for more information refer below link..

http://www.codeproject.com/Articles/224827/Jquery-Ajax-Calling-functions
http://www.codeproject.com/Articles/105210/Easy-Way-to-Implement-Ajax-using-Jquery-in-ASP-NET
Maniraj.M 18-Nov-15 1:16am    
Thanks for the reply but the scenario is about using raw javascript only as well ablove mentioned links doesnt provide any explanation about getting value from particular function.
W Balboos, GHB 18-Nov-15 7:10am    
I use AJAX frequently, although calling php functions. The way an response is typically returned is via an ECHO statement - which is analogous to your response.write().

As for page-load: the reason I use AJAX are twofold. (1) to do SQL queries on the server side; (2) to not have to reload the page with the new data, but only a selected part.*


* 99% of the time, this is innerHTML, but on occasion, I'll rewrite an actual javaScript. This will not execute - so one plays with updating the content of a javaScript function that is already on the page and the call to the function is part of the AJAX script so it will be executed.
Maniraj.M 19-Nov-15 0:16am    
Ya thank u

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900