mlagrange
asked on
Menu control static/dynamic, horizontal orientation
Hello - I must be misunderstanding the whole "static/dynamic" thing; I'm trying to get a static horizontal row of 3 (4, if you count "Home") menu areas, each with 2-4 selections, which I thought would drop down when selected or hovered over.
I'm not trying to do anything fancy (yet); just trying to get it working with basic defaults
As it is, they all just display in one row, like
Home Personnel Hiring Training Certifications Personnel Center Operations Permits Safety Maint and Repairs Centers Admin Users Lookups
(It's funny; when I swiped over the rendered display in the browser and pasted it in here, it pasted in with the hierarchical line breaks & indentation, like I would have expected if was oriented vertically, with all nodes expanded... :-(
How do I get "drop-down" behavior for the menu items?
(ASP.NET 3.5 / Visual Web Developer 2008 Express)
Thanks
I'm not trying to do anything fancy (yet); just trying to get it working with basic defaults
As it is, they all just display in one row, like
Home Personnel Hiring Training Certifications Personnel Center Operations Permits Safety Maint and Repairs Centers Admin Users Lookups
(It's funny; when I swiped over the rendered display in the browser and pasted it in here, it pasted in with the hierarchical line breaks & indentation, like I would have expected if was oriented vertically, with all nodes expanded... :-(
How do I get "drop-down" behavior for the menu items?
(ASP.NET 3.5 / Visual Web Developer 2008 Express)
Thanks
Web.sitemap:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode title="Home" description="Home" url="~/home.aspx" >
<siteMapNode title="Personnel" description="Personnel!" url="~/PersMain.aspx">
<siteMapNode title="Hiring" description="Hiring!" url="~/ActvsHrngList.aspx" />
<siteMapNode title="Training" description="Training!" url="~/ActvsTrngList.aspx" />
<siteMapNode title="Certifications" description="Cert's!" url="~/ActvsCertsList.aspx" />
<siteMapNode title="Personnel" description="Personnel Info Maintenance" url="~/PersList.aspx" />
</siteMapNode>
<siteMapNode title="Center Operations" description="Center Operations!" url="~/SitesMain.aspx">
<siteMapNode title="Permits" description="Permits!" url="~/ActvsPrmtsList.aspx" />
<siteMapNode title="Safety" description="Safety!" url="~/ActvsSftyList.aspx" />
<siteMapNode title="Maint and Repairs" description="MnR!" url="~/ActvsMnRList.aspx" />
<siteMapNode title="Centers" description="Center Info Maintenance" url="~/SitesList.aspx" />
</siteMapNode>
<siteMapNode title="Admin" description="System Administration" url="~/AdmnMain.aspx">
<siteMapNode title="Users" description="User Info Maintenance" url="~/UsersList.aspx" />
<siteMapNode title="Lookups" description="Lookups Maintenance" url="~/LkupsList.aspx" />
</siteMapNode>
</siteMapNode>
</siteMap>
Menu control mark-up:
<asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1"
Orientation="Horizontal" StaticDisplayLevels="3" MaximumDynamicDisplayLevels="4">
</asp:Menu>
ASKER
Well, I'm matching some other samples that all have it laid out that way:
http://aspnet.4guysfromrolla.com/demos/printPage.aspx?path=/articles/111605-1.aspx
http://msdn.microsoft.com/en-us/library/ecs0x9w5(VS.80).aspx
I just realized about the StaticDisplayLevels; I set it to 2, and got the top level (Home), and the 2nd levels (Personnel, Center Op's, Admin)
But I still don't get the items below that, when I click on those 2nd level items.
And a strange thing - when I change the "MaximumDynamicDisplayLeve ls" to "3" on the property sheet of the Menu control, the "3" stays normal font weight, and that attribute dissappears from the Menu control markup. When I change it to "1", the "1" values comes back in bold, and that attrib re-appears in the markup. It's like it knows, that given everything else, that isn't a valid value???
By all means, please set it up the way you think it would work (I see in your response that the closing tag for the Home node is blanked out; did you do that on purpose? )
http://aspnet.4guysfromrolla.com/demos/printPage.aspx?path=/articles/111605-1.aspx
http://msdn.microsoft.com/en-us/library/ecs0x9w5(VS.80).aspx
I just realized about the StaticDisplayLevels; I set it to 2, and got the top level (Home), and the 2nd levels (Personnel, Center Op's, Admin)
But I still don't get the items below that, when I click on those 2nd level items.
And a strange thing - when I change the "MaximumDynamicDisplayLeve
By all means, please set it up the way you think it would work (I see in your response that the closing tag for the Home node is blanked out; did you do that on purpose? )
Did you test it? Does it solve the problem? Yes I removed the closing tag for the Home node, and closed that node inline />. It was just a quick edit going on the premise that fresh eyes may have easily been able to see your issue.
ASKER
I copied your entire <sitemap> in; the "<siteMapNode title="Personnel..." gets a blue squiggly, and the error message "element SiteMap has invalid child element"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That's it! Thanks very much.
I guess it's good that MS keeps everything in a constant state of flux; otherwise, we might be able to settle down and crank things out...
I guess it's good that MS keeps everything in a constant state of flux; otherwise, we might be able to settle down and crank things out...
Open in new window