ASP.NET 페이지에서 비동기 로딩을 구현하는 방법은 무엇입니까?ASP.NET 페이지에서 비동기 로딩을 구현하는 방법은 무엇입니까?
내 ASP.NET 페이지에 3 개의 섹션이 있습니다. 모든 섹션은 독립적입니다.
LoadSection1();
LoadSection2();
LoadSection3();
각 섹션은 약 15 초가 소요됩니다. 비동기로드를 사용하여 페이지로드 시간을 줄이려고합니다.
나는 모든 스레드를 완료하면
// Create thread jobs for each section
ThreadStart PipelinePerformanceThreadJob = new ThreadStart(LoadPipelineSection);
ThreadStart CampaignPerformanceThreadJob = new ThreadStart(LoadCampaignSection);
ThreadStart OperationalThreadJob = new ThreadStart(LoadOperationalSection);
// Create threads
Thread PPThread = new Thread(PipelinePerformanceThreadJob);
Thread CSThread = new Thread(CampaignPerformanceThreadJob);
Thread OSThread = new Thread(OperationalThreadJob);
// Start all the threads
PPThread.Start();
CSThread.Start();
OSThread.Start();
// Join threads with main thread
PPThread.Join();
CSThread.Join();
OSThread.Join();
페이지가로드되는 스레드와 노력했다. 하지만 스레드에서 응답을 얻을 때마다 각 섹션에 대한 데이터를 표시해야합니다. 예 : Thread1이 완료되면 Section2에 대한 데이터를 표시하려고합니다 (thread2와 3이 아직 실행중인 경우에도 마찬가지입니다). 어떻게하면 .NET에서이 작업을 수행 할 수 있습니까?
사용중인 .net의 버전 –
iframe을 사용하여 수행 할 수 있습니다. –
.NET 3.5을 사용 중입니다 – Santhosh