RadTreeNode - NavigateURL is called twice

2 posts, 0 answers
  1. Kavitha
    Kavitha avatar
    6 posts
    Member since:
    Nov 2013

    Posted 18 Apr 2014 Link to this post

    I have constructed a treeview with treenode.
    I have set navigateURL of treenode as follows :
    node.navigateURL = string.Format(@"javascript:alert('hello');");

    When I click on treenode, the javascript in NavigateURL is executed twice. Il displays the alert 2 times.
    Normally, it should display the alert only 1 time.

    In my project, I have set navigateURL to load a page. Since it loads the same page 2 times, I have performance issue.
    Can u tell me why the navigateURL is called twice ?
    What to do so that my treenode calls navigateURL only once?
    Thanks in advance
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 18 Apr 2014 in reply to Kavitha Link to this post

    Hi Kavitha,

    Please have a look into the sample code snippet which works fine at my end.

    ASPX:
    <telerik:RadTreeView ID="radtreeNavigateUrl" runat="server">
        <Nodes>
            <telerik:RadTreeNode Text="Node1">
            </telerik:RadTreeNode>
        </Nodes>
    </telerik:RadTreeView>

    C#:
    protected void Page_Load(object sender, EventArgs e)
    {
        RadTreeNode node = radtreeNavigateUrl.FindNodeByText("Node1") as RadTreeNode;
        node.NavigateUrl = string.Format(@"javascript:alert('hello');");
    }

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top