This is a migrated thread and some comments may be shown as answers.

RadTreeNode - NavigateURL is called twice

1 Answer 60 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Kavitha
Top achievements
Rank 1
Kavitha asked on 18 Apr 2014, 03:33 PM
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

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 19 Apr 2014, 04:49 AM
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.
Tags
TreeView
Asked by
Kavitha
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or