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

    Hi,

    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">  
        <Scripts> 
            <asp:ScriptReference Path="~/Scripts/myScript.js" />    
        </Scripts> 
    </asp:ScriptManagerProxy> 

    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"> 
        ...  
    </telerik:RadTreeView> 


    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
    Admin
    T. Tsonev avatar
    2772 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. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top