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

How to determine if Event is being attached

2 Answers 57 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Robert Bross
Top achievements
Rank 1
Robert Bross asked on 02 Jul 2008, 06:24 PM
Is there anyway to check on the client side whether an event is attatched to a menu item? I am setting the OnClientItemClicked event of the menu and it is not firing when I click a menu item. I'm setting the event in my code behind page on the server side like this...

mainMenu.OnClientItemClicked = "hideMainMenu";

Basically what I want to do is have a "Menu" button that will show the menu and then after they select any of the menu items, I want to hide the meu again. Very similar to how a context menu with the exception that this will be the main menu. It is up to the client though, if they want to always show the menu or only show it when the click the menu button which is why I am setting the OnClientItemClicked event in code vs on the page.

Thanks!

===== Menu Code in ASPX page =============

<telerik:RadMenu ID="mainMenu" runat="server"
                EnableViewState="False" Flow="Vertical" Skin="Vista">
                <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
            </telerik:RadMenu>

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 03 Jul 2008, 07:49 AM
Hi Robert,

I tried this on my end and it is working  as expected. Try the following code snippet.

ASPX:
<script language="javascript"  type="text/javascript" > 
  
 function hideMainMenu() 
 { 
  alert('Clicked'); 
 } 
</script> 


CS:
protected void Page_Load(object sender, EventArgs e) 
    { 
        mainMenu.OnClientItemClicked = "hideMainMenu"
    } 


Thanks
Shinu.
0
Robert Bross
Top achievements
Rank 1
answered on 03 Jul 2008, 12:38 PM
Thanks Shinu! I found that it was a scripting error on my end that was preventing the javascript file from being processed at all. Sorry to have wasted your time with this.
Tags
Menu
Asked by
Robert Bross
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Robert Bross
Top achievements
Rank 1
Share this question
or