ASP.Net getting data from a background thread?
Posted on 2009-04-23
I have a web page that queries a computer on the network for things like, hard disk details, ram, baseboard, users, etc.. via the WMI / SNMP and binds the result to a GridView. This works fine but the problem is that the page takes ages to load becuase it has to wait for each request to finish before it loads the page.
So along come UpdatePanels which are unfortunately asynchronous so it sitll takes as long to load.
Next come's threading which I believe is the answer but can't quite get the code right. I can create multiple threads in the background to run each request, but i cant return the results to the page. I imagine multple UpdatePanels which refresh every second until its designated thread has finished and then display the result and stop refreshing. Which means some UpdatePanels will stop refreshing before others.
So how can you get the result from a background thread and display it to the web page? Preferably the threads must run in a differnt pool to ASP.NET so it doesn't slow down the site.
Many thanks for your expertise.