解决方案 »
- GridView后台分页
- 用vs打开以前做的网站老是弹出提示框:VS遇到问题需要关闭,然后就问我发不发送这个消息
- 弹出对话框之二问
- 百分求解,如何搞定asp.net开发的网张被恶意刷新,在线等,搞定就给分,帮顶也给。
- 请大虾帮忙解决一下,奇怪的Excel导入问题
- Atlas
- 导出数据到Excel时,如果在Excel中添加web 控件?
- 最后40分了,问一个最傻的问题:
- System.Data.DataRowView”不包含名为“BoardID”的属性?
- 在asp.net中如何将form提交到下一页呀,晕
- 防止刷投票除了IP和Cookie还有其它办法没?
- 诡异的asp.net Cookies取值问题
在Page_Load事件中,对Label1,Label2赋时间!!
c#代码:
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
{
Label1.Text = DateTime.Now.ToString();
Label2.Text = DateTime.Now.ToString();
}
}html代码:
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="Button1" runat="server" Text="Button" />
<%= DateTime.Now.ToString() %><br />
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text=""></asp:Label>
<br />
<asp:Timer ID="Timer1" runat="server" Interval="2000" OnTick="Timer1_Tick">
</asp:Timer>
</ContentTemplate>
</asp:UpdatePanel> <asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="Label2" runat="server" Text=""></asp:Label>
<br />
<asp:Timer ID="Timer2" runat="server" Interval="5000" OnTick="Timer2_Tick">
</asp:Timer>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer2" EventName="Tick" />
</Triggers>
</asp:UpdatePanel>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
</Triggers>
</asp:UpdatePanel>