Ashish

Ashish

  • NA
  • 8
  • 25.2k

RenderWebPart() method using BeginInvoke of delegate

Apr 23 2008 9:55 AM

Hi All,

I have a web part which has 2 methods --

1- RenderWebpart -- used to render datagrid. 

2- Getdata(), used to populate datagrid,  which is called asynchronously using delegates BeginInvoke method.

When web part is loaded, ideally it should run GetData() and then RenderWebpart() method because I am calling delegate's begininvoke first, but

when BeginInvoke is called, a delegate is scheduled to be executed on the other thread. However current thread will continue with RenderWebpart() method. Only then will the other thread (  GetData() method ) be executed,

Since my RenderWebpart() method gets called first and then GetData(),

so not able to view the grid which is getting populated in GetData() method.

Can n e one pls help me...

 

Thanks in advance.