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

NavigateUrl = "javascript

3 Answers 203 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Kalpesh Shah
Top achievements
Rank 1
Kalpesh Shah asked on 29 Dec 2010, 11:16 PM

Hello. I have this code where I'm trying to pop-up a small window with javascript from my dynamic list. My code is below, I get two pop-up windows, one (resim.aspx) and another one that has "javascript:my_window=window.open('Resim.aspx?ID=12345678','my_window','width=300,height=300');my_window.focus()" on the address bar. How can I make this sure that only one pop-up window comes up. Thank you.


foreach (String strC in ServiceList)

{

TreeNode newNode = new TreeNode(strC.ToString());

newNode.NavigateUrl = "javascript:my_window=window.open('Resim.aspx?ID=12345678','my_window','width=300,height=300');my_window.focus()"

            newNode.Target = "_blank";

            newNode.SelectAction = TreeNodeSelectAction.Select;

            newNode.PopulateOnDemand = false;

            node.ChildNodes.Add(newNode);

)

3 Answers, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 04 Jan 2011, 02:26 PM
Hi Kalpesh Shah,

Just remove the Target setting and it should be fine.


Regards,
Nikolay Tsenkov
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Jayaram
Top achievements
Rank 1
answered on 08 Sep 2016, 11:18 PM

We am not using Telerik control, but regular <ASP:TreeView> control and adding TreeNode dynamically from code behind.

If we set both TreeNode1.NavigateUrl = "javascript:window.open" and TreeNode1.Target = "_blank", we get 2 popups and the parent page remains as is.

If I remove Target="_blank", the current parent page is submitting to itself with the query string passed to window.open (how's that possible) and throwing error as current parent page doesn't accept query string

0
Ivan Danchev
Telerik team
answered on 09 Sep 2016, 06:26 AM
Hello Jayaram,

This thread's product is RadTreeView, whereas the issue you are experiencing is with the asp:TreeView. Since we do not provide assistance with controls not included in the Telerik UI for ASP.NET AJAX suite, I would suggest posting your question in stackoverflow.

Regards,
Ivan Danchev
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
TreeView
Asked by
Kalpesh Shah
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
Jayaram
Top achievements
Rank 1
Ivan Danchev
Telerik team
Share this question
or