Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have to create menu in asp.net their styling should be like
Parent menu1    Parent menu2   Parent menu3
    |                 |             |
    |                 |             |
Chlid Menu1       Chlid Menu2    Child Menu3
     |                |
     |                |
Grand Child       Grand Child
Grand Child

These menu items are binded with XML to menu control of asp.net
Posted
Updated 14-Jun-12 20:34pm
v4
Comments
Member 8783155 14-Jun-12 6:33am    
plzz answer ??
Sandeep Mewara 14-Jun-12 11:02am    
Did you try anything so far?

Hi you can do one thing. Create a user control and put the below code as:
HTML
<asp:Menu ID="mnuMainMenu" runat="server" Orientation="Horizontal" MaximumDynamicDisplayLevels="1"
    StaticMenuItemStyle-Width="100%" DynamicEnableDefaultPopOutImage="True" StaticPopOutImageUrl="~/Images/divider.gif"
    CssClass="MyMenuStatic" PathSeparator="," DynamicVerticalOffset="2" DynamicMenuStyle-BorderWidth="1"
    StaticBottomSeparatorImageUrl="Images/seprator-vertical.GIF">
    <StaticHoverStyle CssClass="MyMenuStatic" />
    <StaticMenuItemStyle CssClass="MyMenuStatic" />
    <DynamicMenuItemStyle CssClass="MyMenuDynamic" />
    <DynamicHoverStyle CssClass="MyMenuDynamicHover" />
    <Items>
        <asp:MenuItem Text="Parent menu1" Selectable="true" NavigateUrl="javascript:DoNothing()">
            <asp:MenuItem Text="Chlid Menu1" NavigateUrl="javascript:ChlidMenu1Requirements()">
                <asp:MenuItem Text="Grand Child1" SeparatorImageUrl="~/Images/seprator.gif" NavigateUrl="javascript:GrandChild1()">
                </asp:MenuItem>
                <asp:MenuItem Text="Grand Child2" SeparatorImageUrl="~/Images/seprator.gif" NavigateUrl="javascript:GrandChild2()">
                </asp:MenuItem>
            </asp:MenuItem>
        </asp:MenuItem>
        <asp:MenuItem Text="Parent menu2" Selectable="true" NavigateUrl="javascript:DoNothing()">
            <asp:MenuItem Text="Chlid Menu2" NavigateUrl="javascript:ChlidMenu2Requirements()">
                <asp:MenuItem Text="Grand Child3" SeparatorImageUrl="~/Images/seprator.gif" NavigateUrl="javascript:GrandChild3()">
                </asp:MenuItem>
            </asp:MenuItem>
        </asp:MenuItem>
        <asp:MenuItem Text="Parent menu3" Selectable="true" NavigateUrl="javascript:DoNothing()">
            <asp:MenuItem Text="Chlid Menu4" NavigateUrl="javascript:ChlidMenu2Requirements()">
            </asp:MenuItem>
        </asp:MenuItem>
    </Items>
</asp:Menu>

Now few more steps you need to follow
a) find 2 small images 1) separator and 2) small divider
b) menu styling has to be done using css
 
Share this answer
 
v2
Comments
Member 8783155 15-Jun-12 0:25am    
please tell me what code should be embedded in javscript functions ChlidMenu2Requirements(,) GrandChild2()
Member 8783155 15-Jun-12 1:14am    
Grand Child
Grand Child

these should appear on mouseover event upon child menu
in the javascript you shoud write the code of ur project specific requirement
supose ur clild menu one is for opening RajesthanRoyalpage, so write the code accordingly in that again if grand child 2 is for Account detail page of rajesthan royal team, then in java script u can write the code to open that perticular code...

please accept ans if you r satisfied with resulution
Amit
 
Share this answer
 
Comments
Member 8783155 18-Jun-12 1:28am    
Have you run this code , it is not working GrandChild menu is not opening

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900