Vs2005 + Ajax is too simple to implement the previous results. We are familiar with several Ajax extensions controls.
See the code.
<% @ Page Language = "C #" autoeventwireup = "true" codefile = "ttimer. aspx. cs" inherits = "ttimer" %>
<! 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> No title page </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" ontick = "timer1_tick">
</ASP: timer>
<Asp: gridview id = "gridview1" runat = "server">
</ASP: gridview>
</Contenttemplate>
</ASP: updatepanel>
</Div>
</Form>
</Body>
</Html>
using system;
using system. data;
using system. configuration;
using system. collections;
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;
Public partial class ttimer: system. web. UI. page
{< br> private dataset DS = new dataset ();
protected void page_load (Object sender, eventargs e)
{< br> If (! Page. ispostback)
binddata ();
}< br> private void binddata ()
{< br> string SQL = "select class_id, class_name, class_pid from tc_user order by class_id ";
string strconn =" Data Source = SEE-CLN-059 \ pmserver; initial catalog = test; uid = sa; Pwd = ;";
conn = new conn (strconn);
DS = conn. GetSet (SQL );
This. gridview1.datasource = Ds. Tables [0];
This. gridview1.databind ();
}
Protected void timereffectick (Object sender, eventargs E)
{
Binddata ();
}
}
Of course, in case of exceptions, please write the Exception error display by yourself...