Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to use asp.net web.sitemap and menu control with bootstrap

i am trying to use a sitemap and asp.net menu control and skin it with bootstrap.

I have done it using ul and li etc which looks great. But this doesnt add the flexibility of breadcrumbs, roles etc so i would like to use the sitemap and menu control. Anyone got any help. I cant get the toggle drop down etc to work. I have tried accesssing the item in the code behind to add css and toggle etc but it wont work.

<asp:SiteMapDataSource ID="MenuSitemap" SiteMapProvider="MenuSitemap" runat="server"
ShowStartingNode="false"></asp:SiteMapDataSource>
<asp:Menu ID="menFrontEnd" runat="server" Orientation="Horizontal" DataSourceID="MenuSitemap"></asp:Menu>

site map file

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
    <siteMapNode url="/" title="Home"  description="Home">
      <siteMapNode url="/Default" title="Home"  description="Home" />
      <siteMapNode url="#1" title="Shop"  description="Shop">
        <siteMapNode url="/Secure/page1" title="page1"  description="page1" />
        <siteMapNode url="/Secure/page2" title="page2"  description="page2" />
      </siteMapNode>
      <siteMapNode url="#2" title="Maintenance"  description="Maintenance" >
        <siteMapNode url="/Secure/Maintenance/page1" title="page1"  description="Channels" />
        <siteMapNode url="/Secure/Maintenance/page2" title="page2"  description="page2" />
      </siteMapNode>
    </siteMapNode>
</siteMap>

Thanks all

like image 915
Jonnymaboy Avatar asked Sep 10 '13 17:09

Jonnymaboy


1 Answers

I implemented my own control based on this code and control here:

http://bootstrapfriendlywebcontrols.codeplex.com/SourceControl/latest#V1.0/NotAClue.Web.UI.BootstrapWebControls/BootstrapMenu.cs

like image 51
Jonnymaboy Avatar answered Oct 24 '22 21:10

Jonnymaboy