asp.net页面时间实时更新—UpdatePanel的应用
2012-01-28 08:18
447 查看
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="lblTime" runat="server" Text=""></asp:Label>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
</asp:UpdatePanel>
<asp:Timer ID="Timer1" runat="server" ontick="Timer1_Tick" Interval="1000">
</asp:Timer>
protected void Timer1_Tick(object sender, EventArgs e)
{
this.lblTime.Text = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
}
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="lblTime" runat="server" Text=""></asp:Label>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
</asp:UpdatePanel>
<asp:Timer ID="Timer1" runat="server" ontick="Timer1_Tick" Interval="1000">
</asp:Timer>
protected void Timer1_Tick(object sender, EventArgs e)
{
this.lblTime.Text = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
}
相关文章推荐
- asp.net页面时间实时更新—UpdatePanel的应用
- ASP.NET UpdatePanel实时更新时间
- 动态的呈现页面. 模拟ASP.NET UpdatePanel部分更新配合WebServices.
- 同一个ASP.NET页面放置多个UpdatePanel分别刷新的解决办法。.
- 结合UpdatePanel实例讲解ASP.NET的页面缓存技术
- [转]针对ASP.NET页面实时进行GZIP压缩优化的几款压缩模块的使用简介及应用测试!(附源码)
- 针对ASP.NET页面实时进行GZIP压缩优化的几款压缩模块的使用简介及应用测试!(附源码)
- 针对ASP.NET页面实时进行GZIP压缩优化的几款压缩模块的使用简介及应用测试
- ASP.Net 如何在UpdatePanel (ajax)更新后执行Javascript
- asp.net updatepanel里gridview更新需要点鼠标两次问题解决
- asp.net ajax 使用updatepanel进行更新后的提示
- ASP.Net 如何在UpdatePanel (ajax)更新后执行Javascript
- 针对ASP.NET页面实时进行GZIP压缩优化的几款压缩模块的使用简介及应用测试!(附源码)
- 同一个ASP.NET页面放置多个UpdatePanel分别刷新的解决办法。.
- 页面间隔半秒钟更新时间 Asp.net使用Comet开发http长连接示例分享
- asp.net ajax updatepanel控件使用(网页自动部分更新)
- aspnetajax UpdatePanel控件简单应用
- asp.net ajax 使用updatepanel进行更新后的提示
- 一起来学ASP.NET Ajax(六)之UpdatePanel简单应用及其原理
- ASP.NET Ajax 调试技巧:用 FireBug 调试 UpdatePanel 不更新问题