you can work around
ThreadPool[
^]
for example
first of all you need to create
static method/function which is actually called in threading, like this:-
public static void ThreadProc(Object stateInfo) {
Console.WriteLine("Hello from the thread pool.");
}
and call it like this...
ThreadPool.QueueUserWorkItem(new WaitCallback(ThreadProc));
for passing value to your method you can do something like this:-
public class ThreadPara{
public int a{get;set;}
public int b{get;set;}
}
public static void ThreadSum(Object stateInfo) {
ThreadPara data = stateInfo as ThreadPara;
int sum = data.a + data.b;
Console.WriteLine("Sum is :" + sum);
}
public static void ThreadMul(Object stateInfo) {
ThreadPara data = stateInfo as ThreadPara;
int mul = data.a * data.b;
Console.WriteLine("Mul is :" + mul);
}
and call it in button click like this..
protected void btn1_Click(object sender, EventArgs e)
{
ThreadPara data = new ThreadPara();
data.a = 10;
data.b = 20;
ThreadPool.QueueUserWorkItem(new WaitCallback(ThreadSum),data);
ThreadPool.QueueUserWorkItem(new WaitCallback(ThreadMul),data);
}