The demo web project that ships with the VS2010 contains a system.web.ui.webcontrols.menu control.
That particular menu includes the IncludeStyleBlock property.
When the IncludeStyleBlock property is set to False the menu is displayed as it supposed to. The menu gets destroyed if i set that property to True. So here is my main question…
Is there any way of preserving the appearence of the menu, with the IncludeStyleBlock property set to false?
P.S. I have to set it to False… since my provider does not support the forth generation of the .NET framework.
You misspoke in your question. You begin by saying the menu is perfect when IncludeStyleBlock property is set to False and breaks when True. Then you say it is broken when False and you want a workaround for making in work under False.
Because of this confusion I am basing this answer off the assumption that you want to mimic the default style set by ASP.NET when IncludeStyleBlock is set to true but while keeping
IncludeStyleBlock="False"First: Since the menu displays perfectly when
IncludeStyleBlock="True", what you need to do is set it to true and preview the rendered source code. From the source code you can find the copy of the default CSS block that the Menu control generates by default. This is what you need.Second: Once you have the CSS block, simply copy and paste it into your markup (inline or externally). Once you do that, you can make
IncludeStyleBlock="False"and the now inline/external CSS block will preserve the appearance of the menu. (As a bonus, this is a small performance boost from caching CSS)