[quote="hellowahab"]Why you want flyTreeView be a static variable. Simply you have to pass the reference of the control you have got on your page. The thread or function simply have access to that contol or surely populate it. Or if you are having your function on the same page all you need is, to access the control directly.
Simply pass the reference of control. Not a temporary variable
public class ThreadProc : ITask
{
private FlyTreeView FlyTreeView1 = null;
public ThreadProc(ref FlyTreeView FlyTreeView11)
{
FlyTreeView1 = FlyTreeView11;
}
...
}
simply pass the control on your page, and code should be like that
public class ThreadProc : ITask
{
//---------------private FlyTreeView FlyTreeView1 = null;
public ThreadProc(ref FlyTreeView FlyTreeView11)
{
FlyTreeView1 = FlyTreeView11;
}
private void DoSomeTask()
{
ThreadProc(FlyTreeView1); //FlyTreeView1 being you control on web page
}
}