제목 : ASP.NET Ajax UpdatePanel과 Timer를 사용하여 User Control 주기적 다시 요청
글번호:
|
|
342
|
작성자:
|
|
레드플러스
|
작성일:
|
|
2014/03/28 오전 2:28:00
|
조회수:
|
|
3835
|
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<uc1:SqlDashboardChart runat="server" ID="SqlDashboardChart" ChartTypeText="1" ChartTitleText="CPU" />
<asp:Label Text="text" ID="lbl" runat="server" />
<asp:Timer ID="Timer1" runat="server" Interval="5000" OnTick="Timer1_Tick"></asp:Timer>
</ContentTemplate>
</asp:UpdatePanel>
</div>
protected void Timer1_Tick(object sender, EventArgs e)
{
lbl.Text = DateTime.Now.ToString();
UpdatePanel1.Update();
}