RadMenu OnClientItemClicked randomly fires on page load?

2 posts, 0 answers
  1. mkasuboski
    mkasuboski avatar
    17 posts
    Member since:
    Jul 2008

    Posted 15 Jul 2009 Link to this post

    I have this RadMenu in my web page:
                <telerik:RadMenu ID="RadMenu1" runat="server" Width="757px" EnableViewState="false" OnClientItemClicked="menuItemClicked" 
                    style="z-index: 500" Skin="B2B" EnableEmbeddedSkins="false"
                    <CollapseAnimation Type="OutQuint" Duration="200" /> 

    The javascript function, 'menuItemClicked', is defined below the above declaration of the RadMenu control in the HTML, and bascially sets specific values on the page when the user clicks on the menu.  The menu choices are setup in the code behind.  Most of the time everything works perfectly, but I see this error in the Firefox error console randomly.
    'menuItemClicked is not defined'
    When this error happens, the menu does not work anymore, i.e. mousing over it does not expand the root items so that the user can make a choice.  I do not see this error if the user clicks on a menu item, only when they make a selection from several different asp.net dropdownlist controls on the page.  The error does not consistently appear for a specific dropdownlist control that the user may click on, it is totally random.
    After getting the error and having the menu stop responding (no mouseover expansion), if the user makes another dropdown selection, the error does not reappear and the menu starts working correctly again.  Each dropdownlist has AutoPostBack = True.

  2. T. Tsonev
    T. Tsonev avatar
    2817 posts

    Posted 16 Jul 2009 Link to this post


    A quick fix that you can try is to move the script block that contains the menuItemClicked function above the RadMenu definition. It's important that it's placed before the closing tag of the form, but move it before the menu just to be sure. I hope this helps.

    Tsvetomir Tsonev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top