This is a migrated thread and some comments may be shown as answers.

RadMenu OnClientItemClicked randomly fires on page load?

1 Answer 70 Views
Menu
This is a migrated thread and some comments may be shown as answers.
mkasuboski
Top achievements
Rank 1
mkasuboski asked on 15 Jul 2009, 02:54 PM
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" /> 
            </telerik:RadMenu> 

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.

1 Answer, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 16 Jul 2009, 10:54 AM
Hi,

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.

Greetings,
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.
Tags
Menu
Asked by
mkasuboski
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or