How to do client callback for each item in a foreach statement using c#?
<p>I want to show each item Id that is doing now dynamically in a foreach statement.
How to do some kind of client callback to show the item Id in a foreach statement?</p>

<pre><code>&lt;asp:Label ID="Label1" runat="server" Text="Label"&gt;&lt;/asp:Label&gt;
&lt;asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" /&gt;
</code></pre>

<p>.</p>

<pre><code>protected void Button1_Click(object sender, EventArgs e)
    {
        List&lt;int&gt; list = new List&lt;int&gt;()
        {
            1,2,3,4,5
        };

        foreach (var item in list)
        {
            Label1.Text = string.Format("I'm doing item {0} now.", item.ToString());
Page.RegisterStartupScript("", string.Format("&lt;script&gt;alert('doing item {0} now')&lt;/script&gt;", item.ToString()));
            Thread.Sleep(1 * 1000);
        }
    }
</code></pre>
