Page
Code :
Copy code The Code is as follows: <% @ page Language = "C #" autoeventwireup = "true" codefile = "default. aspx. cs" inherits = "_ default" %>
<% @ Register Assembly = "ajaxcontroltoolkit" namespace = "ajaxcontroltoolkit" tagprefix = "PC3" %>
<! Doctype HTML public "-// W3C // dtd xhtml 1.1 // en" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head id = "head1" runat = "server">
<Title> untitled page </title>
<Style type = "text/CSS">
# Updatepanel3 {
Border-Right: Gray 1px solid; border-top: Gray 1px solid;
Border-left: Gray 1px solid; border-bottom: Gray 1px solid;
Width: 200px; Height: 200px; position: relative;
Float: Left; margin-left: 10px; margin-top: 10px;
}
</Style>
</Head>
<Body>
<Form ID = "form1" runat = "server">
<Asp: scriptmanager id = "scriptmanager1" runat = "server"/>
<Asp: updatepanel id = "updatepanel3" runat = "server">
<Contenttemplate>
<Asp: timer id = "timer1" runat = "server" interval = "1000" ontick = "timer1_tick">
</ASP: timer>
<Asp: Label id = "label3" runat = "server" text = "label"> </ASP: Label> <br/>
</Contenttemplate>
</ASP: updatepanel>
<Asp: Label id = "label4" runat = "server" text = "label"> </ASP: Label>
</Form>
</Body>
</Html>
CS file code: copy Code the code is as follows: using system;
using system. data;
using system. configuration;
using system. web;
using system. web. security;
using system. web. ui;
using system. web. UI. webcontrols;
using system. web. UI. webcontrols. webparts;
using system. web. UI. htmlcontrols;
using system. threading;
Public partial class _ default: system. web. UI. page
{< br> protected void page_load (Object sender, eventargs e)
{< br> label4.text = "initialization time:" + datetime. now. tostring ();
timer1.interval = 1000;
}< br> protected void timereffectick (Object sender, eventargs E)
{< br> label3.text = "Refresh time:" + datetime. now. tostring ();
}< BR >}