Click here to Skip to main content
15,894,740 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have a ASP.Net menu that appears horizontally on click of each tree node of a treeview.

It has got sub menus and it is displaying properly.

The problem is when i am on the sub menus, the parent menu disappears and the sub menu only is displaying.

Can somebody please help me!!

Lucy
Posted

There is some issue in your codebase of Menu. Look into that. If you don't get it and need a fix on that menu control only, try posting important snippets of it to look at.

Otherwise, you can have a look at one of many Menu controls present published here at codeproject. Pick the one that suits you.
For example:
ASP.NET Horizontal Menu Control[^]
Very Compatible DHTML Menu ASP.NET User Control[^]
 
Share this answer
 
Thanks for the reply Sandeep!!

Following is my code:

Javascript:
C#
function showhide(obj,onlink,arg)
        {
            targetObject = document.getElementById(obj).style;

            globalObject = targetObject;
            if(onlink)
            {
                clearTimeout(ourTimer);
                for (i=0; i < menuArray.length; i++)
                {
                    var tempObject = document.getElementById(menuArray[i]).style;
                    tempObject.visibility = "hidden";
                }
                targetObject.visibility = 'visible';
                targetObject.position = "absolute";
                var x = getPosition(event).x;
                var y = getPosition(event).y;
                if (y > 490 && y < 590)
                {
                    targetObject.top = getPosition(event).y - 90;
                    targetObject.left = getPosition(event).x;
                }
                else
                {
                    targetObject.top = getPosition(event).y;
                    targetObject.left = getPosition(event).x;
                }
                isActive = true;
            }
            else
            {
                isActive = false;
                layerTimer();
            }
        }



ASP.Net:

XML
<asp:Menu ID="menuHover" BackColor="LightCyan" runat="server" DisappearAfter="900"
                style="visibility:hidden; position:absolute; top:0; left:0; z-index: 999;">
        <Items>
            <asp:MenuItem Text="Option1" Value="Option1" >
                <asp:MenuItem Text="Option 1.1" Value="test1"></asp:MenuItem>
                <asp:MenuItem Text="Option 1.2" Value="test2"></asp:MenuItem>
                <asp:MenuItem Text="Option 1.3" Value="test3"></asp:MenuItem>
            </asp:MenuItem>
            <asp:MenuItem Text="Option2" Value="Option2" ></asp:MenuItem>
            <asp:MenuItem Text="Option3" Value="Option3">
                <asp:MenuItem Text="Option 3.1" Value="Option 3.1"></asp:MenuItem>
                <asp:MenuItem Text="Option 3.2" Value="Option 3.2"></asp:MenuItem>
                <asp:MenuItem Text="Option 3.3" Value="Option 3.3"></asp:MenuItem>
            </asp:MenuItem>
            <asp:MenuItem Text="Option4" Value="Option4"></asp:MenuItem>
        </Items>
    </asp:Menu>


This is a very simple menu structure n the ShowHide() function is used to populate the menu on mouseover.

But when i am on the sub menus, n if we keep the mouse over the sub menu for some time, the parent menu is displaying.

Please help me, if possible!!

Lucy
 
Share this answer
 
Have u check it on all browser?

I think its style related problem.
if u change the style or backcolor
of menucontrol then it can solve ur problems.
 
Share this answer
 

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