<asp:Menu ID="Menu1" DataSourceID="xmlDataSource" runat="server" BackColor="#F7F6F3" DynamicHorizontalOffset="5" Font-Names="Verdana" ForeColor="#7C6F57" StaticSubMenuIndent="10px" Autopostback="True" Font-Size="0.8em" Height="21px" Orientation="Horizontal"> <staticselectedstyle backcolor="#5D7B9D" /> <staticmenuitemstyle horizontalpadding="5px" verticalpadding="2px" /> <dynamichoverstyle backcolor="#7C6F57" forecolor="White" /> <dynamicmenustyle backcolor="#F7F6F3" /> <dynamicselectedstyle backcolor="#5D7B9D" /> <dynamicmenuitemstyle horizontalpadding="5px" verticalpadding="2px" /> <databindings> <asp:MenuItemBinding DataMember="MenuItem" NavigateUrlField="NavigateUrl" TextField="Text" ToolTipField="ToolTip"/>; </databindings> <statichoverstyle backcolor="#7C6F57" forecolor="White" /> <asp:XmlDataSource ID="xmlDataSource" TransformFile="~/TransformXSLT.xsl" XPath="MenuItems/MenuItem" runat="server>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes" encoding="utf-8" /> <xsl:template match="/Menus"> <menuitems> <xsl:call-template name="MenuListing" /> </menuitems> </xsl:template> <xsl:template name="MenuListing"> <xsl:apply-templates select="Menu" /> </xsl:template> <xsl:template match="Menu"> <menuitem> <xsl:attribute name="Text"> <xsl:value-of select="Text" /> </xsl:attribute> <xsl:attribute name="ToolTip"> <xsl:value-of select="Description" /> </xsl:attribute> <xsl:attribute name="NavigateUrl"> <xsl:text>?Sel=</xsl:text> <xsl:value-of select="Text" /> </xsl:attribute> <xsl:if test="count(Menu) > 0"> <xsl:call-template name="MenuListing" /> </xsl:if> </menuitem> </xsl:template> </xsl:stylesheet>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)