MenuItem in .NET
-
I have a problem. If I have a submenu item in a menu tree and it is not in the FIRST parent menu then it does not work BUT if I add this to the first menu it works in the first as well as any other menuitem I add this submenu too? ANY ideas? I have a sub running to pickup a onmouseclick on the menuitems. Sub onclick() Does something Menuitem1 Submenu item1 Submenu item2 Submenu item3 Menuitem2 Submenu item4 Submenu item5 Submenu item 1,2,3 works fine and on a mouse click on them the sub runs, but 4,5 does not do anyhting. IF I now do the following. Menuitem1 Submenu item1 Submenu item2 Submenu item3 Submenu item4 Menuitem2 Submenu item4 Submenu item5 THEN Submenu item 4 works fine in both the Menuitem1 as well as Menuitem2 parents. Both works. I do not WANT Submenu item4 under Menuitem1 but if I do not have it there it does not work. ANY ideas? Here is the almost full page code. I had to ADD all the submenues to my first parent manu jsut to get it to work, but if I take them out none of the other parent manues submenues work at all. ---------------------------------------------------------------------------------------------- <%@ Page Language="VB" %> Sub NavigationMenu_MenuItemClick(ByVal sender As Object, ByVal e As MenuEventArgs) Dim MessageTransfer = e.Item.Value 'MsgBox(e.Item.Value) 'message.text = MessageTransfer Response.Write("<input type='hidden' id='TestString' value=" & MessageTransfer & ">") End Sub
-
I have a problem. If I have a submenu item in a menu tree and it is not in the FIRST parent menu then it does not work BUT if I add this to the first menu it works in the first as well as any other menuitem I add this submenu too? ANY ideas? I have a sub running to pickup a onmouseclick on the menuitems. Sub onclick() Does something Menuitem1 Submenu item1 Submenu item2 Submenu item3 Menuitem2 Submenu item4 Submenu item5 Submenu item 1,2,3 works fine and on a mouse click on them the sub runs, but 4,5 does not do anyhting. IF I now do the following. Menuitem1 Submenu item1 Submenu item2 Submenu item3 Submenu item4 Menuitem2 Submenu item4 Submenu item5 THEN Submenu item 4 works fine in both the Menuitem1 as well as Menuitem2 parents. Both works. I do not WANT Submenu item4 under Menuitem1 but if I do not have it there it does not work. ANY ideas? Here is the almost full page code. I had to ADD all the submenues to my first parent manu jsut to get it to work, but if I take them out none of the other parent manues submenues work at all. ---------------------------------------------------------------------------------------------- <%@ Page Language="VB" %> Sub NavigationMenu_MenuItemClick(ByVal sender As Object, ByVal e As MenuEventArgs) Dim MessageTransfer = e.Item.Value 'MsgBox(e.Item.Value) 'message.text = MessageTransfer Response.Write("<input type='hidden' id='TestString' value=" & MessageTransfer & ">") End Sub
-
How do you attach the onclick client function to the treenode? Are you sure that the method is attached to the nodes that are not working as you said?
I found the problem. My parents that does have children has all got values of "" and this does not work. Each parent and child need to have a unique value it seems. I set each parent with a unique value from 1 - 10 and simple check to see if the value from the selected menuitem is NOT a numeric value between 1 - 10 and if not then do the iframe src change. I did not know that the parents values should be unique and should have values. Thanks in any case. I am just glad it is working now. Must say took me ages to figure this out as I could find no help in telling me that this should be. :)
this is me