I have successfully designed a customized menu interface using ASP.NET.
<asp:Menu ID="Name1" runat="server" OnMenuItemClick="DoSth_MenuItemClick" Visible="true">
<Items>
<asp:MenuItem Text="Function description" Value="Val" ToolTip="ToolTip description" meta:resourcekey="resourceKey">
</asp:MenuItem>
</Items>
</asp:Menu>
Now, I am attempting to dynamically enable/disable some of the MenuItems using JavaScript. Here's the function I tried:
function hideMenu() {
var menu = $get('<%=Name1.ClientID %>');
menu.getItems().getItem(0).set_enabled(false);
}
Although I was able to retrieve the menu object in the first line, it appears to be an HTMLTableElement and encounters an error on the second line.
Could you suggest an alternative approach to achieve this functionality with JavaScript?