title: ASP - how to use ajax modal/telerik radwindow to update control on previous page
body: <p>The setup I have is very simple.</p>
  
  <p>on <code>Details.aspx</code> i have a formview and a button.  When the button is clicked it opens up a telerik radwindow to <code>editdetails.aspx</code>.  On <code>editdetails.aspx</code> i have a button that says submit.  What I want to do is close the radwindow that was opened and then refresh only the formview on <code>details.aspx</code>.  Any help is welcomed!</p>
  
  <p><code>details.aspx</code></p>
  
  <pre><code>&lt;asp:FormView ID="fvDealershipInformation" runat="server" BorderStyle="Solid" BorderWidth="1px"&gt;
      &lt;HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" /&gt;
      &lt;HeaderTemplate&gt;
          &lt;div&gt;
              &lt;h3&gt;
                  Dealership Information&lt;/h3&gt;
          &lt;/div&gt;
      &lt;/HeaderTemplate&gt;
      &lt;ItemTemplate&gt;
          &lt;table id="tblDealershipInformation" border="0" cellpadding="10" cellspacing="0"&gt;
              &lt;tr class="formviewCommandRow"&gt;
                  &lt;td&gt;
                      &lt;asp:ImageButton runat="server" ID="EditFormViewButton" ImageUrl="~/secure/images/edit.jpg"
                          ToolTip="Edit Dealer Information"  OnClientClick="ShowEditDealerInformationForm(); return false;"/&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
  &lt;/table&gt;
      &lt;/ItemTemplate&gt;
  &lt;/asp:FormView&gt;
  </code></pre>
  
  <p>here is <code>ShowEditDealerInformationForm()</code></p>
  
  <pre><code>function ShowEditDealerInformationForm() {
              var url = window.location.search;
              url = url.replace("?", ''); // remove the ?
              var oWnd = window.radopen("editdetails.aspx?" + url, "UserListDialog");
              oWnd.maximize();
          }
  </code></pre>
  
  <p>this opens up editdetails.aspx just fine, so on editdetails.aspx i have a button and that i want to close the radwindow and then update the formview on information.aspx</p>
  
  <p><code>editdetails.aspx</code></p>
  
  <pre><code>&lt;telerik:RadButton runat="server" ID="UpdateContactInformation" Text="Submit" OnClick="RadButton_DealerContactRecord_Click"
          Skin="Web20"&gt;
      &lt;/telerik:RadButton&gt;
  
      protected void RadButton_DealerContactRecord_Click(object sender, EventArgs e)
  {
  
  ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebind('navigateToInserted');", true);
  
  }
  
  function CloseAndRebind(args) { 
      {
          GetRadWindow().close(); 
      }
  
      function GetRadWindow() {
          var oWindow = null;
          if (window.radWindow) oWindow = window.radWindow;
          //Will work in Moz in all cases, including clasic dialog               
          else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well) 
          return oWindow;
      }
  </code></pre>