MasterPage.master |
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server">
<title></title>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder> </head> <body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> 현재시간 : <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> <asp:Timer ID="Timer1" runat="server" Interval="1000" ontick="Timer1_Tick"> </asp:Timer> </ContentTemplate>
</asp:UpdatePanel>
<hr />
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
<hr />
</div>
</form> </body> </html> |
MasterPage.master.cs |
protected void Timer1_Tick(object sender, EventArgs
e) {
Label1.Text = DateTime.Now.ToLongTimeString(); } |
마스터 페이지 선택을 체크 하신 후에 추가해주세요
FrmScriptManagerProxy.aspx |
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<p>
<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
</asp:ScriptManagerProxy> </p>
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate> <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label> <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
</ContentTemplate>
</asp:UpdatePanel> </asp:Content> |
FrmScriptManagerProxy.aspx.cs |
protected void Button1_Click(object sender, EventArgs
e) {
Label2.Text = DateTime.Now.ToLongTimeString(); } |
결과화면 |
[그림73-1] |
'ASP.NET' 카테고리의 다른 글
09.ASP.NET - C# ASP.NET 에서 FCKeditor 사용하기 [1] (0) | 2009.11.04 |
---|---|
74.C# ASP.NET - 용어정리 (0) | 2009.10.29 |
72.C# ASP.NET - Ajax를 이용한 시간 출력 2 (1) | 2009.10.28 |
71.C# ASP.NET - Ajax를 이용한 시간 출력 (0) | 2009.10.28 |
70.C# ASP.NET - Ajax (0) | 2009.10.28 |
Comments