我有Label
而Button
在一个UpdatePanel
,现在我叫龙工艺与ForEach
环On Button Click
我想是更新文本Label
完成Loop.Is有任何简单的方法后更改Label
的文本在运行时,我听到了一些我们可以用Iframe
来做到这一点但我对此没有任何想法。更改标签文本
CODE
ASPX
<asp:UpdatePanel ID="UpdatePanelUpdate" runat="server" UpdateMode="Conditional"> <ContentTemplate>
<div>
<asp:Button ID="ButtonUpdate" runat="server" Text="Update"
onclick="ButtonUpdate_Click" />
<br />
<br />
<asp:Label ID="LabelUpdateCount" runat="server" Text=""></asp:Label>
< /div>
</ContentTemplate>
</asp:UpdatePanel>
aspx.cs
protected void ButtonUpdate_Click(object sender, EventArgs e)
{
int count = 0;
foreach()
{
do my stuff();
count = count + 1;
LabelUpdateCount.Text = count.ToString();
}
}
所以,我想在运行时显示标签的变化.....
请显示一些源代码...你试过了什么?什么不工作? – Yahia 2012-03-14 19:35:16