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

Reload/Postback on main Page

1 Answer 283 Views
Window
This is a migrated thread and some comments may be shown as answers.
Pierre
Top achievements
Rank 1
Pierre asked on 05 May 2009, 08:16 PM
Hi @all,

i have some problems:

Page A: Is opened with a Java Script from a login site (Popup)

Now, i open a detail item page (Page B / RadWindow) with a button inside a grid. (Request Query strings....)  So all works fine.

But - i dont know how to reload my page A after closing Page B... i modify some datafields inside the item Page (B) and after clicking the ok button - the cs code update my database und close the RadWindow. But - my Page A - how can i refresh this page after closing the windows?

i have try this: after clicking ok - (Page B) i use this code:
Response.Write("<script type='text/javascript'>window.open('PageA.aspx?View=2&ANr=" + lbl_ArNumber.Text + "','Portal','toolbar=no,width=950,height=730,resizable=no,scrollbars=no')</script>"); 
The Page A is open with javascript too, so i use the same name "Portal" - this code reload the page and view the "View" Query string i select the RadTap.

But - perhaps is a basicly problem. The page isn´t up to date. The fields has got the old value. If i use the F5 button from the IE - the page load the new data´s. In Page A i havnt got some code like (Page.IsPostback ...)

Can someone help me?!
thanks
Markus

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 06 May 2009, 01:41 PM
Hi,

Please check the code snippet below to access a function in a  Page A window from Page B window. This code should work in the case when you are trying to open the Page B window using the RadWindowManager  from the browser window(Default.aspx).

Refer the link:
http://www.telerik.com/help/aspnet-ajax/window_programmingcallingfunctions.html

JS:
<script type="text/javascript"
 
function GetRadWindow() 
  var oWindow = null
  if (window.radWindow) 
     oWindow = window.radWindow; 
  else if (window.frameElement.radWindow) 
     oWindow = window.frameElement.radWindow; 
  return oWindow; 
function CallFn()    
{        
  //Get a reference to the parent page (Default.aspx)        
  var oWnd = GetRadWindow();        
  //get a reference to the Page A RadWindow        
  var dialogB = oWnd.get_windowManager().getWindowByName( "RadWindow1");        
  // by using get_contentFrame, call the postback function in Page A 
  dialogB.get_contentFrame().contentWindow.CalledFn();    
}   
 
 
 
</script> 


Here  "CalledFn" is the function in Page A  where you can call a _doPostBack to refresh the page.

You can also refer the link below for info on how to perform the postback.

http://www.telerik.com/community/forums/aspnet-ajax/window/call-a-code-behind-function-from-radwindow.aspx#816826

Thanks,
Shinu





Tags
Window
Asked by
Pierre
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or