Long posts .. sorry
I read about it and tried to try different solutions for a couple of days, but I cannot find the most obvious choice for my predicament.
About my situation; I present to the user a page that will contain a couple of different repeaters showing some information based on the result of several webservice calls. I would like the data to be added using the update panel (which will query the results table once every two or three seconds until it finds the results), so I really would like to display the page, and then when the data is “ready” .
The page asks the controller to display the information, and the controller checks the results table to see if there is anything that can be found. If no specific data is found, it calls the GetData () method in WebServiceName.cs. GetData does not return anything, but should start an async operation that receives data from the web service. The controller returns null, and the UpdatePanel waits for the next request.
When this operation is completed, it will save the data in the appropriate place in db, where the controller will find it the next time the page asks for it.
The solution I have now is to start another thread. I will host the page on a shared web server, and I do not know if this will cause any problems.
So, the current code that is on the .aspx page:
Thread t = new Thread(new ThreadStart(CreateService));
t.Start();
}
void CreateService()
{
ServiceName serviceName = new ServiceName(user, "12345", "MOVING", "Apartment", "5100", "0", "72", "Bill", "rate_total", "1", "103", "serviceHost", "password");
}
, Begin [Method] End [Method], , , . , , , . , , , - ?
[] Async, , [] AsyncCompleted , .
, , , -, , : http://msdn.microsoft.com/en-us/magazine/cc164128.aspx, threadpool , ( ).
, ? ( , )
, .