I have an ASP.NET website containing the following
<asp:UpdatePanel ID="UpdatePanel1" runat="server" >
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
I have created a thread function. And during the execution of this function I would like to update some controls on the user interface.
protected void Page_Load(object sender, EventArgs e)
{
new Thread(new ThreadStart(Serialize_Click)).Start();
}
protected void Serialize_Click()
{
for (int i = 1; i < 10; i++)
{
Label1.Text = Convert.ToString(i);
UpdatePanel1.Update();
System.Threading.Thread.Sleep(1000);
}
}
How could I update a web-control during a thread-execution? do I need to force the "UpdatePanel1" to post-back? how?