Radmenuitem call function inside navigateurl ?

2 posts, 0 answers
  1. David Blok
    David Blok avatar
    42 posts
    Member since:
    Nov 2009

    Posted 08 Dec 2009 Link to this post

    How can i call a function inside the navigate url property ?

    Below is the code:
    Im trying to call a function with function.getpageid inside the navigateurl.

    <script language="javascript" type="text/javascript">  
        function onClicking(sender, eventArgs) {  
            var item = eventArgs.get_item();  
            var navigateUrl = item.get_navigateUrl();  
            if (navigateUrl && navigateUrl != "#") {  
                var oWnd = radopen(navigateUrl, "WindowName");  
            <telerik:RadContextMenu ID="RadContextMenu2" runat="server" OnClientItemClicking="onClicking">        
                <telerik:ContextMenuControlTarget ControlID="Mediaarea" />  
                <telerik:RadMenuItem runat="server" Text="Media wijzigen" NavigateUrl='~/test.aspx?PageID=<%# functions.getpageID %>'></telerik:RadMenuItem>     
            <telerik:RadWindowManager ID="RadWindowManager1" runat="server">        
    <div id="Mediaarea">  
    <img src="Upload/Design/GUI/images/powerplusxq/media.jpg" />  

    But i get result as PageID=%3C%

    anyone has a suggestion ?
  2. Georgi Tunev
    Georgi Tunev avatar
    7207 posts

    Posted 08 Dec 2009 Link to this post

    Hello David,

    This issue is not directly related to RadWindow or RadMenu. The problem here is the incorrect usage of the data binding syntax. More information on the subject is available in varous resources in the Net - for exampl you could check this MS article - http://support.microsoft.com/kb/307860

    In your case I would suggest to set the NavigateUrl property of the menu directly on the server - this way you will avoid the problem that you currently experience. Another way to do this is to output the server variable in a hidden field and read that field in your JavaScript code.


    Sincerely yours,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top