Also learn ASP. NET 2.0 Ajax 1.0: Use scriptmanager, updatepanel, updateprogress
1. Download and install
Aspajaxextsetup. MSI
Aspajaxctp. MSI
Ii. Install the adventureworks Sample Database
3. Open vs. net2005 and select ASP. NET Ajax-enabled web site.
4. default. aspx page
Code:
<Div> Prefix = "o"?>
<Asp: scriptmanager id = "scriptmanager1" runat = "server">
</ASP: scriptmanager>
</Div>
<Asp: updatepanel id = "updatepanel1" runat = "server">
<Contenttemplate>
<Asp: gridview id = "gridview1" runat = "server" allowpaging = "true" cellpadding = "4" datasourceid = "sqldatasource1"
Forecolor = "#333333" gridlines = "NONE" onpageindexchanged = "gridview1_pageindexchanged">
<Footerstyle backcolor = "#990000" font-bold = "true" forecolor = "white"/>
<Rowstyle backcolor = "# fffbd6" forecolor = "#333333"/>
<Selectedrowstyle backcolor = "# ffcc66" font-bold = "true" forecolor = "Navy"/>
<Pagerstyle backcolor = "# ffcc66" forecolor = "#333333" horizontalalign = "center"/>
<Headerstyle backcolor = "#990000" font-bold = "true" forecolor = "white"/>
<Alternatingrowstyle backcolor = "white"/>
</ASP: gridview>
<Asp: sqldatasource id = "sqldatasource1" runat = "server" connectionstring = "<% $ connectionstrings: adventureworksconnectionstring %>"
Selectcommand = "select firstname, lastname from HumanResources. vemployee order by lastname, firstname">
</ASP: sqldatasource>
</Contenttemplate>
</ASP: updatepanel>
<Asp: updateprogress id = "updateprogress1" runat = "server">
<Progresstemplate>
Getting employees... retrieving employee list...
</Progresstemplate>
</ASP: updateprogress>
5. Add the local connection string web. config
</Configsections> Prefix = "o"?>
<Connectionstrings>
<Add name = "adventureworksconnectionstring" connectionstring = "Server = xxx \ sqlexpress; database = adventureworks; Integrated Security = sspi; Max pool size = 4; min pool size = 4; "providername =" system. data. sqlclient "/>
</Connectionstrings>
Run
Paste it to word, paste it to HTML, and paste it here