Page

How to use SiteMapPath control in asp.net

// Web.sitemap //


<?xml version="1.0" encoding="utf-8" ?>  
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >  
  <siteMapNode url="Default.aspx" title="Home"  description="Home Page">  
    <siteMapNode url="StandardToolBox.aspx" title="Standard ToolBox Control"  description="Standard ToolBox Control">  
      <siteMapNode url="BulletedList.aspx" title="BulltedList Example"  description="BulltedList Control Simple Example" />  
      <siteMapNode url="CheckBox.aspx" title="CheckBox Example"  description="CheckBox Control Simple Example" />  
      <siteMapNode url="CheckBoxList.aspx" title="CheckBoxList Example"  description="CheckBoxList Control Simple Example" />  
      <siteMapNode url="Image.aspx" title="Image Control Example" description="Image Control Simple Example"/>  
    </siteMapNode>  
    <siteMapNode url="DataToolBox.aspx" title="Data ToolBox Control"  description="Data ToolBox Control">  
      <siteMapNode url="SqlDataSource.aspx" title="SqlDataSource Example"  description="SqlDataSource Simple Example" />  
      <siteMapNode url="XmlDataSource.aspx" title="XmlDataSource Example"  description="XmlDataSource Simple Example" />  
    </siteMapNode>  
  </siteMapNode>  
</siteMap>  



// Default.aspx //


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %> 
  
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
  
<script runat="server">  
  
</script>  
  
<html xmlns="http://www.w3.org/1999/xhtml">  
<head runat="server">  
    <title>SiteMapPath Control Simple Example</title>  
</head>  
<body>  
    <form id="form1" runat="server">  
    <div>  
        <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />  
        <asp:SiteMapPath ID="SiteMapPath1" runat="server"></asp:SiteMapPath>  
        <br /><br />  
        <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/SeaBeach.jpg" Height="300" Width="400" />  
    </div>  
    </form>  
</body>  
</html>  

No comments:

Post a Comment