Reputation: 5620
I am using Page Methods in ASP.NET, in the code behind I have written a method which should call a JavaScript function for each loop, then it should come back and continue the loop.
Is it possible?
[WebMethod]
public static void GetStatus()
{
for (int i = 0; i < 10; i++)
{
System.Threading.Thread.Sleep(500);
//Call javascript function
}
}
Any help will be greatly appreciated, thanks.
Upvotes: 1
Views: 1325
Reputation: 13571
It looks like you are trying to implement a call back mechanism. Take a look at this MSDN article. From what i understand you want to do something like: 1. Call a page/web method via JS 2. Call some JS method when page/web method returns or is done.
Maybe u should expand the question
Upvotes: 0
Reputation: 40393
The client and server don't talk to each other - sounds like you need to call the web method over and over again from javascript for each value.
Upvotes: 1