R
Raymond Du
Hi,
This is my first mutiple threading progam, I have an AST.Net page
zThreadPool.aspx which has one button: button1 and one Label: label1. The
following code snippet does not work at all:
public partial class zThreadPool : System.Web.UI.Page
{
void CallbackProc(object obj1)
{
((Label)obj1).Text = DateTime.Now.ToString();
}
protected void Button1_Click(object sender, EventArgs e)
{
ThreadPool.QueueUserWorkItem(new WaitCallback(CallbackProc), Label1);
}
}
When I click on button1, label1 is not updated, no exceptions thrown. I put
a break point at
((Label)obj1).Text = DateTime.Now.ToString();
The debugger did break on this line.
Any Ideas?
TIA
This is my first mutiple threading progam, I have an AST.Net page
zThreadPool.aspx which has one button: button1 and one Label: label1. The
following code snippet does not work at all:
public partial class zThreadPool : System.Web.UI.Page
{
void CallbackProc(object obj1)
{
((Label)obj1).Text = DateTime.Now.ToString();
}
protected void Button1_Click(object sender, EventArgs e)
{
ThreadPool.QueueUserWorkItem(new WaitCallback(CallbackProc), Label1);
}
}
When I click on button1, label1 is not updated, no exceptions thrown. I put
a break point at
((Label)obj1).Text = DateTime.Now.ToString();
The debugger did break on this line.
Any Ideas?
TIA