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

Get name of parent page

1 Answer 137 Views
Window
This is a migrated thread and some comments may be shown as answers.
Ajay
Top achievements
Rank 1
Ajay asked on 09 May 2011, 01:36 PM
Hi,

I have a page which opens a radwindow and this page in radwindow further opens another radwindow recursively inside one another.

Now after navigating to the multiple level I need the name/path of the Parent page which caused the sequential load of windows.

The use of sending the data between parent/child will not work as some of the calls are made using static href links.

Also is there any way of restricting the number of windows that can be opened inside each other recursively?

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 12 May 2011, 10:07 AM
Hello Ajay,

I am not quite sure what exactly do you mean by "The use of sending the data between parent/child will not work as some of the calls are made using static href links.", but the functionality that you are looking for, can easily be achieved with some JavaScript.
The main points in such approach are:
1. In JavaScript, you could always get a reference to the topmost page (i.e. the one directly opened in the browser), by using the top property. You can use this fact, to build the logic that will limit the total number of RadWindows that can be opened.
2. While inside a content page that is shown in a RadWIndow, you can get a reference to that RadWindow, by using the GetRadWindow() function. Once you have access to the RadWIndow object, you can get the parent page as well, by using the BrowserWIndow property from RadWindow's API. From this point on, just get the location.href property of the parent window, and you'll get its Url
e.g.
function checkParent()
{
    var oWnd = GetRadWindow();
    var parentPage = oWnd.BrowserWindow;
    alert(parentPage.location.href);
}

I created a simple demo that you can use as a base for your implementation. In it, I limit the maximum number of opened RadWindows to 5 and I get the parent page's Url by using the function shown above.
Please check the demo's code for more details.


Kind regards,
Georgi Tunev
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.

Tags
Window
Asked by
Ajay
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or