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

ClientSideCommand NavigateURL

1 Answer 89 Views
Menu
This is a migrated thread and some comments may be shown as answers.
iomega 55
Top achievements
Rank 1
iomega 55 asked on 12 Aug 2009, 04:00 AM
hi:
Is there any way to have something like this?

menu item 1:
Navigateurl="javascript:fnOpenWin(xxxx,xxx)"

menu item 2:
Navigateurl="javascript:fnOpenWin(xxxx,yyyy)"


I mean, if there is a way to call a javascript function directly from the navigateurl. I have a dynamic creation of the menu, so I need to have only in the clientside the commands( and the code) required for that particular user profile.

Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 12 Aug 2009, 01:23 PM
Hello,

The NavigateUrl property is for specifying the URL to link to when the item is clicked. One suggestion to execute the clientside code is attaching " OnClientItemClicked " event for radmenu and execute the code as shown below.

C#:
 
protected void Page_Load(object sender, EventArgs e) 
    RadMenu menu = new RadMenu();         
    RadMenuItem item1 = new RadMenuItem("Item1"); 
    RadMenuItem item2 = new RadMenuItem("Item2"); 
 
    menu.Items.Add(item1); 
    menu.Items.Add(item2); 
    menu.OnClientItemClicked = "test"
 
    this.form1.Controls.Add(menu); 

JavaScript:
 
<script type="text/javascript"
function test() 
    // Execute the client code 
</script> 

-Shinu.
Tags
Menu
Asked by
iomega 55
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or