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

Reloading Parent Page (repeatedly)

1 Answer 97 Views
Window
This is a migrated thread and some comments may be shown as answers.
David Mullings
Top achievements
Rank 1
David Mullings asked on 28 Feb 2011, 04:08 PM

I am trying to figure out how to reload the parent page of my application from inside of a RadWindow without the RadWIndow closing or reloading. In my application, users have the ability to open up a pop-up window that will list all of their current customers. When they click on the customer's name, the parent window is suppose to load up that particular customer's information.

Here is the code that I have to reload the parent page:

 

 

 

 

function RefreshParentPage(Url) {

 

 

GetRadWindow().BrowserWindow.location = Url;

 

}

The Url passed in the Url for the customer summary page.  This serve as a starting point for drilling down into more detail on a customer.

Right when I run the application, the pop-up appears correctly. When the user clicks on the customer's name, the parent page navigates to the summary page correctly, but the pop-up window closes. I am trying to get the summary page to stay visible until the user actually closes it.

How can I do that?

Thanks,
David

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 01 Mar 2011, 06:35 AM
Hello Davis,

If you don't set the window property VisibleOnPageLoad to true, the window will close when you are trying to reload the parent page. This is the expected behavior.

You can call a JavaScript function on the main page, that uses RadAjaxManager's ajaxRequest() to update the desired control. Since there is no postback, the popup window will stay opened due to the fact that AJAX is used to refresh the parent page.
Here is the sample code:

JavaScript: [ChildWindow].
function RefreshParent()
{
     GetRadWindow().BrowserWindow.refresh(); //calling main page function refresh from child window.
 }


JavaScript: [MainWindow].
function refresh()
 {
     var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
     ajaxManager.ajaxRequest();
 }

C#:
protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
  {
      //your code here
  }

Also I suggest to examine this demo

Thanks,
Shinu.
Tags
Window
Asked by
David Mullings
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or