There is no special page navigation control in ASP. NET 2.0, but it can be implemented using sitemapdatasource configuration and datalist.
In the sitemapdatasource control, you must create a web. sitemap XML file that stores the website structure,
For example
<? XML version = "1.0" encoding = "UTF-8"?>
<Sitemap xmlns = "http://schemas.microsoft.com/AspNet/SiteMap-File-1.0">
<Sitemapnode url = "default. aspx? Id =-1 "Title =" Homepage ">
<Sitemapnode url = "default2.aspx? Id = 0 "Title =" commodity "/>
<Sitemapnode url = "default3.aspx? Id = 1 "Title ="Community"/>
</Sitemapnode>
</Sitemap>
Then, in default. aspx, writeCode:
<% @ Page Language = "C #" %>
<SCRIPT runat = Server>
Protected void page_load ()
{
Int Index =-1;
Int32.tryparse (request. querystring ["ID"], out index );
Tabs. selectedindex = index;
}
</SCRIPT>
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head id = "head1" runat = "server">
<Title> untitled page </title>
<Style>
A
{
Color: #000000;
Text-Decoration: none;
}
. Mytab
{
Background: # 6666ff;
Padding: 4px;
}
. Mytabselected
{
Background: # ff00ff;
Padding: 4px;
}
</Style>
</Head>
<Body>
<Form ID = "form1" runat = "server">
<Div>
<Table>
<Asp: datalist repeatdirection = horizontal id = "tabs" runat = "server" performanceid = "sitemapperformance1">
<Itemtemplate>
<TD width = "4" Height = "20" valign = "TOP" nowrap class = "mytab">
<A href = '<% # eval ("url") %>'> <% # eval ("title") %> </a>
</TD>
</Itemtemplate>
<Selecteditemtemplate>
<TD width = "4" Height = "20" valign = "TOP" nowrap class = "mytabselected">
<A href = '<% # eval ("url") %>'> <% # eval ("title") %> </a>
</TD>
</Selecteditemtemplate>
</ASP: datalist>
</Table>
<Asp: sitemapdatasource showstartingnode = false ID = "sitemapdatasource1" runat = "server"/>
</Div>
</Form>
</Body>
</Html>
You can achieve the effect of simple page navigation.