Reload/Postback on main Page

2 posts, 0 answers
  1. Pierre
    Pierre avatar
    15 posts
    Member since:
    Jun 2008

    Posted 05 May 2009 Link to this post

    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
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 06 May 2009 Link to this post

    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





Back to Top