Create Web Form to demonstrate use of Website Navigation controls and Site Map.

 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 of our website"> 

    <siteMapNode url="Default1.aspx" title="Page2"  description="" /> 

    <siteMapNode url="Default2.aspx" title="Page3"  description="" /> 

  </siteMapNode> 

</siteMap> 

Default.aspx 

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" 

Inherits="Practical5.Default" %> 

<!DOCTYPE html> 

<html xmlns="http://www.w3.org/1999/xhtml"> 

<head runat="server"> 

    <title></title> 

</head> 

<body> 

    <form id="form1" runat="server"> 

        <div> 

            <asp:Menu ID="Menu1" runat="server" BackColor="#FFFBD6" 

DataSourceID="SiteMapDataSource1" DynamicHorizontalOffset="2" Font-Names="Verdana" 

Font-Size="0.8em" ForeColor="#990000" StaticSubMenuIndent="10px"> 

                <DynamicHoverStyle BackColor="#990000" ForeColor="White" /> 

                <DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" /> 

                <DynamicMenuStyle BackColor="#FFFBD6" /> 

                <DynamicSelectedStyle BackColor="#FFCC66" /> 

                <StaticHoverStyle BackColor="#990000" ForeColor="White" /> 

                <StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" /> 

                <StaticSelectedStyle BackColor="#FFCC66" />             </asp:Menu> 

        </div> 

        <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" /> 

    </form> 

</body> 

</html> 

Output:-



Post a Comment

0 Comments