Reputation: 33
I'm trying to create a database driven dropdown menu. For now i'm using a EO.WEB third party component for ASP, which is preety good, but it doesen't give me quite what I need (design-wise). I have a SQL procedure written which gives me the child node names for the menu and their links (eg. CAST(('showInfo.aspx?cityId='+''+CAST(dbo.city.id AS varchar(50))+'&'+'typeId='+CAST(dbo.object_type.id AS varchar(50))) AS varchar(50)) AS 'WebSiteLink') I just need to find the simplest way to implement it and customize as much as possible.
A reference to a third party component or some other app or anything would be most helpfull!
Thanks in advance for the anwsers!
Upvotes: 2
Views: 2134
Reputation: 6054
ASP.NET has a built in menu control, which you can do a lot with. You can bind it to your data or add MenuItems one at a time in the codebehind.
<asp:menu id="NavigationMenu" CssClass="NavigationMenu"
staticdisplaylevels="2" DynamicHorizontalOffset="1"
staticsubmenuindent="1px" MaximumDynamicDisplayLevels="4"
orientation="Horizontal"
DynamicPopOutImageUrl="~/Images/right-arrow.gif"
StaticPopOutImageUrl="~/Images/drop-arrow.gif"
datasourceid="MenuSource"
runat="server" Height="30px">
<staticmenuitemstyle ItemSpacing="10" CssClass="staticMenuItemStyle"/>
<statichoverstyle CssClass="staticHoverStyle" />
<StaticSelectedStyle CssClass="staticMenuItemSelectedStyle"/>
<DynamicMenuItemStyle CssClass="dynamicMenuItemStyle" />
<dynamichoverstyle CssClass="menuItemMouseOver" />
<DynamicMenuStyle CssClass="menuItem" />
<DynamicSelectedStyle CssClass="menuItemSelected" />
<DataBindings>
<asp:MenuItemBinding DataMember="siteMapNode"
NavigateUrlField="url" TextField="title"
ToolTipField="description" />
</DataBindings>
</asp:menu>
Upvotes: 3