View Single Post
  #3  
Old 08-23-2007, 03:33 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 905
S.Vinothkumar is on a distinguished road
Wink Re: How to Populate menu using sitemap and asp .net menu control and c#:

Copy the following code in to your sitemap,

Code:
<siteMapNode url="Main.aspx" title="Main Page"  description="Main Page">
  <siteMapNode url="Menu1.aspx" title="Menu one"  description="Menu one" />
  <siteMapNode url="Menu2.aspx" title="Menu Two"  description="Menu Two">
  <siteMapNode url="SubMenu1.aspx" title="SubMenu One"  
                                                          description="SubMenu One"/>
  </siteMapNode>
</siteMapNode>
And copy the following code in to your master page,

Code:
<asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1
                                                                                    "></asp:Menu>

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

<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
  </asp:contentplaceholder>
And create the following pages as content pages in your master page.

Main.aspx
Menu1.aspx
Menu2.aspx
SubMenu1.aspx

Then run the project….that’s it…

For more see in my articles,

S.Vinothkumar: ASP.NET Menu using Sitemap

ASP.NET Menu using Sitemap - The Code Project - ASP.NET
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!

Last edited by S.Vinothkumar : 08-23-2007 at 03:35 AM.
Reply With Quote