views:

975

answers:

5

I am attempting to use a .sitemap file to build a menu in my site; however I am having a number of issues with the output.

Firstly, the table output wasn't nice - I downloaded the 'CSSFriendly' DLL (http://www.codeplex.com/cssfriendly).. This now gives the output in ul and li's ..

But I want the menu to be free of javascript or css that pops up levels one at a time etc.

I thought that for a start using the StaticDisplayLevels would resolve this, but it seems to ignore it and just output the first level, I then have to mouse over to get more menu options..

I suppose the long and short is: should people stay clear of menu controls and just write the markup themselves? If not and it isn't a horrible route to go down - How can I get rid of all the formatting and mouse over jazz.. I just want a whole menu, horizonally displayed (I can do this with my CSS though).

Thanks for any help, also apologies if this question seems garbled (its frustration). Pete

+2  A: 

I my experience the ASP.net menu can be tamed and it's not as bad as it may at first appear.

(I have tried to find some code for your static display level problem but can't access my SVN repository at the moment. However I have had the same problem and it's fairly easy to fix.)

Of course the MS menu is never going to be as neat as one you could write yourself in HTML, but it's great if you don't want to spend too long over it and you want to use all the SiteMapProvider stuff.

Just don't fall into the "everything MS provide is rubbish I'll have to write my own" trap, because it's really not that bad.

Chris Needham
A: 

I thought there would be a way, just haven't managed to get the hang of it .. yet!

Any code snippets appreciated, or better still if there's a built-in way I just don't know about.

Thanks for the reply.

peteski22
+2  A: 

Pete,

I've dug out some of my old code, which uses the asp.net menu control. There's very little in there, setting StaticDisplayLevels to 2 and Orientation to "Horizontal" makes it all work fine. Most of the work is in skinning it (and there are a couple of hacks to highlight the current location if some of the urls differ only by querystring).

However, switch to use the CSS friendly adaptor and I get the exact same problems you describe (only the root item is shown and can't get to render horizontally).

Makes me wonder if the CSS friendly menu adaptor is broken? There are working examples for an old version of the code http://www.asp.net/CSSAdapters/Menu.aspx

Chris

Chris Needham
A: 

Hmmn, bad times.. I wonder what's happened to it! Oh well :( No nicely created menu's for me (for now).

Thanks for the reply Chris! :)

peteski22
+1  A: 
CraigD