RadScriptManagerProxy and user control

2 posts, 0 answers
  1. Cedric
    Cedric avatar
    24 posts
    Member since:
    Mar 2008

    Posted 31 Mar 2010 Link to this post


    In my User Control I got a ScriptManagerProxy with a ScriptReference property in which I load a Javascript file.


    <asp:ScriptManagerProxy ID="smp" runat="server">  
            <asp:ScriptReference Path="~/Scripts/myScript.js" />    

    This Javascript file contains this function:


    function onNodeClicked(sender, args) {  

    Finally, in my User Control, I have a RadTreeView:

    <telerik:RadTreeView ID="myTree" runat="server OnClientNodeClicked="onNodeClicked"> 

    This control is loaded dynamically in a aspx page. When I execute this, I receive this message:
                                Microsoft JScript runtime error: 'onNodeClicked' is undefined

    What's wrong ?





  2. T. Tsonev
    T. Tsonev avatar
    2762 posts

    Posted 31 Mar 2010 Link to this post

    Hi Cedric,

    The script is probably getting registered after the control initialization clauses. Add the script above the TreeView itself using inline script tag

    <script type="text/javascript" src='<%= ResolveUrl("~/Scripts/myScript.js") %>'></script>

    I hope this helps.

    Sincerely yours,
    Tsvetomir Tsonev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. DevCraft R3 2016 release webinar banner
Back to Top