ClientSideCommand NavigateURL

2 posts, 0 answers
  1. iomega 55
    iomega 55 avatar
    64 posts
    Member since:
    Dec 2004

    Posted 11 Aug 2009 Link to this post

    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.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 12 Aug 2009 Link to this post

    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.
Back to Top