Ajax UpdatePanel的问题,急啊!!!

Gao19870101 Gao19870101 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="更新时间:"></asp:Label>
<asp:Label ID="Lable2" runat="server" Text="Label" ForeColor="Red"></asp:Label><br />
<br />
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div>
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="Lable3" runat="server" Text="第二次更新:"></asp:Label>
<asp:Label ID="Lable4" runat="server" Text="Lable1" ForeColor="Yellow"></asp:Label><br />
<br />
</ContentTemplate>
</asp:UpdatePanel>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
</div>

这是两个div
protected void Button1_Click(object sender, EventArgs e) 
{
this.Lable2.Text = DateTime.Now.ToString();
this.UpdatePanel1.Update();
Thread.Sleep(2000);
this.Lable4.Text = "你好,时间更新结束";
this.UpdatePanel2.Update();
}

这是Button事件,我想通过点击Button按钮来实现先显示label2,过两秒之后再显示Label4,但是我现在写的这个Button方法是两个一起输出显示。由于这两天一直在发帖,都没有积分了,希望会的大侠帮一下忙,谢谢了!!!
...全文

相关推荐

评论 8
收藏 已收藏
分享
返回顶部
Gao19870101
.NET社区 62,273 成员 668,968 内容