Create defa9.9.aspx page
Use sriptmanager and updatapanel to put one in updatapanel, implement Timer, and use two viewstates. viewstate ["Index"] stores the content printed by subscript and viewstate ["content ,,,
Code:
Using system;
Using system. Collections. Generic;
Using system. LINQ;
Using system. Web;
Using system. Web. UI;
Using system. Web. UI. webcontrols;
Using system. Threading;
Public partial class default6: system. Web. UI. Page
{
Public int index {
Get {return (INT) viewstate ["Index"];}
Set {viewstate ["Index"] = value ;}
}
Public String content
{
Get {return (string) viewstate ["content"];}
Set {viewstate ["content"] = value ;}
}
Protected void page_load (Object sender, eventargs E)
{
If (! Ispostback)
{
Content = "Hello, I'm your grandfather ,,,,";
Index = 0;
Timer1.enabled = true;
}
}
Protected void timereffectick (Object sender, eventargs E)
{
This. label1.text + = content [Index]. tostring ();
Index ++;
If (index> = content. Length ){
Timer1.enabled = false;
}
}
}
Page:
<% @ Page Language = "C #" autoeventwireup = "true" codefile = "default9.aspx. cs" inherits = "default9" %>
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head runat = "server">
<Title> </title>
</Head>
<Body>
<Form ID = "form1" runat = "server">
<Div>
<Asp: scriptmanager id = "scriptmanager1" runat = "server">
</ASP: scriptmanager>
<Asp: updatepanel id = "updatepanel1" runat = "server">
<Contenttemplate>
<Asp: timer id = "timer1" runat = "server" interval = "1000" ontick = "timer1_tick">
</ASP: timer>
<Asp: Label id = "label1" runat = "server" text = ""> </ASP: Label>
</Contenttemplate>
</ASP: updatepanel>
</Div>
</Form>
</Body>
</Html>