ClientID does not work

3 posts, 1 answers
  1. dany7487
    dany7487 avatar
    88 posts
    Member since:
    Jan 2008

    Posted 06 May 2009 Link to this post

    Hello, Telerik.
    I have upgraded my application to radcontrols for asp.net ajax but now I have found some issues that dont work:
    I had these lines that worked before, but not now: (function attached to treeview event: OnClientNodeChecking="TreeViewBeforeClick")

    function

     

    TreeViewBeforeClick(nodo)

     

    {

     

    nodo.expand();

     

     

    var nodeDIV = document.getElementById(nodo.ClientID);

     

     

    var link = nodeDIV.getElementsByTagName("A");

     

    ...

    It does not work because nodo.ClientID is null, however nodo has value.
    Can you help?
    Thanks,
    Daniel.
  2. Answer
    ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 07 May 2009 Link to this post

    Hi,

    first I would ask you to take a short look at the documentation:
    http://www.telerik.com/help/aspnet-ajax/tree_clientonclientnodechecking.html

    There you can see that you get two parameters - sender and args.
    And args allows you to get access to the node:

    var myNode=args.get_node();

    node is an object - documented here:
    http://www.telerik.com/help/aspnet-ajax/tree_clientradtreenode.html

    I don't know WHAT you want to do with the hyperlink you are trying to retrieve in your snippet - but the node object provides methods
    like get_navigateUrl or set_navigateUrl.

    Regards

    Manfred
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. dany7487
    dany7487 avatar
    88 posts
    Member since:
    Jan 2008

    Posted 07 May 2009 Link to this post

    Hi, Manfred.

    You were right.
    Using get_navigateUrl or set_navigateUrl was the best approach.
    Thank you very much for helping me.
    Regards,
    Daniel.
Back to Top