In ASP.NET 2.0, there is no special page navigation control, but it can be achieved using SITEMAPdatasource and DATALIST.
In the SITEMAPDATASOURCE control, a special XML file of web.sitemap needs to be created, which stores the structure of the website.
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="Product"/>
<siteMapNode url="default3.aspx?id=1" title="Community"/ >
</siteMapNode>
</siteMap>
After that, in default.aspx, write the code:
<%@ 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" DataSourceID="SiteMapDataSource1">
<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.