D
Drew
I upgraded to the ASP.NET 4.0 platform due to a number of features and have
hit a number of very basic problems. I've seen only a couple of references
to these on the internet, others were unable to reproduce them.
Unfortunately, I can do nothing but reproduce them.
--levelsubmenustyles
First of all the asp.net 4.0 menu control works fine in table mode. I wanted
it to use list mode due to the CSS styling issues in table form and have
unfortunately gotten nowhere. For example, when I use the code at the top of
this article.
http://msdn.microsoft.com/en-us/library/ms366731.aspx
It won't render. I get the exception
Unable to cast object of type 'System.Web.UI.WebControls.SubMenuStyle'
to type 'System.Web.UI.WebControls.MenuItemStyle'
and no, reverting to 3.5 style rendering is not an option. I've tried
manually setting the List render mode, no luck. set the same mode to render
as a table and it works.
--LevelMenuItemStyles
While the LevelSubmenuStyles collection throws a casting exception, the
LevelMenuItemStyles seems to work, kinda. At least it renders, but it
ignores my first level. So if I specify
<LevelMenuItemStyles>
<asp:MenuItemStyle CssClass="Level1Style" />
<asp:MenuItemStyle CssClass="Level2Style" />
<asp:MenuItemStyle CssClass="Level3Style" />
</LevelMenuItemStyles>
It will never use Level1Style anywhere in my menu. Instead, the top level UL
tag will render as
<ul class="level1">
and then the subsequent <li> tags will have class="level2 Level2Style etc"
as expected.
I'd love to know why the CSS styling in my menus are so broken. Not sure if
there's some environmental issue that's causing this because I'd expect much
more outrage in the community if this was widespread. I'm running this as a
file system web site on windows 7 ultimate 64bit with Visual Web Developer
2010 Express.
Thanks in advance for your help.
hit a number of very basic problems. I've seen only a couple of references
to these on the internet, others were unable to reproduce them.
Unfortunately, I can do nothing but reproduce them.
--levelsubmenustyles
First of all the asp.net 4.0 menu control works fine in table mode. I wanted
it to use list mode due to the CSS styling issues in table form and have
unfortunately gotten nowhere. For example, when I use the code at the top of
this article.
http://msdn.microsoft.com/en-us/library/ms366731.aspx
It won't render. I get the exception
Unable to cast object of type 'System.Web.UI.WebControls.SubMenuStyle'
to type 'System.Web.UI.WebControls.MenuItemStyle'
and no, reverting to 3.5 style rendering is not an option. I've tried
manually setting the List render mode, no luck. set the same mode to render
as a table and it works.
--LevelMenuItemStyles
While the LevelSubmenuStyles collection throws a casting exception, the
LevelMenuItemStyles seems to work, kinda. At least it renders, but it
ignores my first level. So if I specify
<LevelMenuItemStyles>
<asp:MenuItemStyle CssClass="Level1Style" />
<asp:MenuItemStyle CssClass="Level2Style" />
<asp:MenuItemStyle CssClass="Level3Style" />
</LevelMenuItemStyles>
It will never use Level1Style anywhere in my menu. Instead, the top level UL
tag will render as
<ul class="level1">
and then the subsequent <li> tags will have class="level2 Level2Style etc"
as expected.
I'd love to know why the CSS styling in my menus are so broken. Not sure if
there's some environmental issue that's causing this because I'd expect much
more outrage in the community if this was widespread. I'm running this as a
file system web site on windows 7 ultimate 64bit with Visual Web Developer
2010 Express.
Thanks in advance for your help.