title: Exchange data between webform and popup(another webform inside IFrame)
body: <p>I have this WebForm</p>
  
  <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CorridaExecutadaCorridaCompleta.aspx.cs" Inherits="LightSwitchApplication.WebForms.CorridaExecutadaCorridaCompleta" MasterPageFile="~/mainPrincipal.Master" %&gt;
  
  &lt;%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="aja" %&gt;
  
  &lt;asp:Content ContentPlaceHolderID="contentLinks" runat="server" ID="contentLinks"&gt;
  &lt;link href="../bootstrap-3.2.0-dist/css/bootstrap.min.css" rel="stylesheet" /&gt;
  &lt;script src="../bootstrap-3.2.0-dist/js/bootstrap.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="../jquery/jquery-2.1.1.min.js"&gt;&lt;/script&gt;
  
  &lt;asp:ScriptManager ID="ScriptManager" runat="server"&gt;&lt;/asp:ScriptManager&gt;
  
  &lt;/asp:Content&gt;
  
  &lt;asp:Content ContentPlaceHolderID="contentBody" ID="contentBody" runat="server"&gt;
  
  &lt;asp:Panel ID="Panl1" runat="server" CssClass="Popup" align="center" Style="display: none"&gt;
      &lt;iframe style="width: 850px; height: 500px;" id="irm1" src="EnderecoCorridaCorridaExecutadaCompleta.aspx?IdEnderecoCorrida=4201337" runat="server"&gt;&lt;/iframe&gt;
      &lt;br /&gt;
      &lt;asp:Button ID="btnClose" runat="server" Text="Fechar" /&gt;
  &lt;/asp:Panel&gt;
  &lt;div class="container"&gt;
      &lt;div class="row"&gt;
          &lt;div class="col-sm-8"&gt;
              &lt;asp:Label runat="server" ID="lblCorrida" Text="Corrida: "&gt;&lt;/asp:Label&gt;
              &lt;asp:DropDownList runat="server" ID="ddCorridas" Width="100%" DataTextField="NomeCompletoCorrida" DataValueField="Id"&gt;&lt;/asp:DropDownList&gt;
          &lt;/div&gt;
          &lt;div class="col-sm-4"&gt;
              &lt;asp:Button runat="server" ID="btnProcurar" Text="Procurar" class="btn btn-info btn-default" OnClick="btnProcurar_Click" /&gt;
  
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;hr /&gt;
      &lt;div class="row"&gt;
          &lt;asp:Repeater ID="repMovimentosCorridaExecutada" runat="server" OnItemDataBound="repMovimentosCorridaExecutada_ItemDataBound"&gt;
              &lt;HeaderTemplate&gt;
                  &lt;div class="col-sm-6"&gt;
                      &lt;asp:Label runat="server" ID="lblNomeCorrida" Text="Nome da corrida: "&gt;&lt;/asp:Label&gt;
                  &lt;/div&gt;
                  &lt;div class="col-sm-12"&gt;
                      &lt;asp:TextBox runat="server" ID="txbNomeCorrida" Text='&lt;%# NomeCorrida %&gt;' Width="100%"&gt;&lt;/asp:TextBox&gt;
                  &lt;/div&gt;
                  &lt;div class="col-sm-6"&gt;
                      &lt;asp:Label runat="server" ID="lblMotorista" Text="Motorista: "&gt;&lt;/asp:Label&gt;
                  &lt;/div&gt;
                  &lt;div class="col-sm-12"&gt;
                      &lt;asp:TextBox runat="server" ID="txbMotorista" ReadOnly="true" Text='&lt;%# NomeCompletoMotorista %&gt; ' Width="100%"&gt;&lt;/asp:TextBox&gt;
                  &lt;/div&gt;
                  &lt;tr&gt;
                      &lt;td colspan="6"&gt;
                          &lt;hr /&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/HeaderTemplate&gt;
              &lt;ItemTemplate&gt;
                  &lt;aja:ModalPopupExtender ID="mp1" runat="server" PopupControlID="Panl1" TargetControlID="btnAlterarOrigem"
                      CancelControlID="btnClose" BackgroundCssClass="Background"&gt;
                  &lt;/aja:ModalPopupExtender&gt;
                  &lt;div class="col-sm-4"&gt;
                      &lt;div class="row"&gt;
                          &lt;div class="col-sm-6"&gt;
                              &lt;asp:Label runat="server" ID="lblTipoMovimentoCorridaExecutada" Text="Tipo de Movimento:"&gt;&lt;/asp:Label&gt;
                          &lt;/div&gt;
                          &lt;div class="col-sm-12"&gt;
                              &lt;asp:TextBox runat="server" ID="txbTipoMovimentoCorridaExecutada" Text='&lt;%# Eval("NomeTipoMovimentoCorrida")%&gt;' Width="100%"&gt;&lt;/asp:TextBox&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="row"&gt;
                          &lt;div class="col-sm-6"&gt;
                              &lt;asp:Label runat="server" ID="lblEnderecoCompleto" Text="Endereço completo:"&gt;&lt;/asp:Label&gt;
                          &lt;/div&gt;
                          &lt;div class="col-sm-12"&gt;
                              &lt;asp:TextBox runat="server" ID="txbEnderecoOrigem" Text='&lt;%# Eval("EnderecoOrigemCompleto")%&gt;' Width="100%" &gt;&lt;/asp:TextBox&gt;
                              &lt;asp:Button runat="server" ID="btnAlterarOrigem" Text="Alterar" CssClass="btn btn-default btn-info" OnClick="btnAlterarOrigem_Click" /&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="row"&gt;
                          &lt;div class="col-sm-6"&gt;
                              &lt;asp:Label runat="server" ID="lblEnderecoDestino" Text="Endereço completo:"&gt;&lt;/asp:Label&gt;
                          &lt;/div&gt;
                          &lt;div class="col-sm-12"&gt;
                              &lt;asp:TextBox runat="server" ID="txbEnderecoDestino" Text='&lt;%# Eval("EnderecoOrigemCompleto")%&gt;' Width="100%"&gt;&lt;/asp:TextBox&gt;
                              &lt;asp:Button runat="server" ID="btnAlterarDestino" Text="Alterar" CssClass="btn btn-default btn-info"/&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="row"&gt;
                          &lt;div class="col-sm-6"&gt;
                              &lt;asp:Label runat="server" ID="lblDistanciaOrigemDestino" Text="Distância em KM:"&gt;&lt;/asp:Label&gt;
                          &lt;/div&gt;
                          &lt;div class="col-sm-12"&gt;
                              &lt;asp:TextBox runat="server" ID="txbDistanciaOrigemDestino" Text='&lt;%# Eval("DistanciaOrigemDestino")%&gt;' Width="100%"&gt;&lt;/asp:TextBox&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="row"&gt;
                          &lt;div class="col-sm-6"&gt;
                              &lt;asp:Label runat="server" ID="lblTempoOrigemDestino" Text="Tempo em Mins."&gt;&lt;/asp:Label&gt;
                          &lt;/div&gt;
                          &lt;div class="col-sm-12"&gt;
                              &lt;asp:TextBox runat="server" ID="txbTempoOrigemDestino" Text='&lt;%# Eval("TempoOrigemDestino")%&gt;' Width="100%"&gt;&lt;/asp:TextBox&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:Repeater&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>and this second webform(the one opened as Popup)</p>
  
  <pre><code> &lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EnderecoCorridaCorridaExecutadaCompleta.aspx.cs" Inherits="LightSwitchApplication.WebForms.EnderecoCorridaCorridaExecutadaCompleta" MasterPageFile="~/mainPrincipal.Master" %&gt;
  
   &lt;asp:Content ContentPlaceHolderID="contentBody" runat="server"&gt;
  &lt;asp:SqlDataSource runat="server" ID="sqlDataSourceEnderecoCorrida" ConnectionString="&lt;%$ ConnectionStrings:SOSSemTempoData %&gt;" ConflictDetection="CompareAllValues" DeleteCommand="DELETE FROM [EnderecoCorrida] WHERE [Id] = @original_Id AND [Logradouro] = @original_Logradouro AND [Numero] = @original_Numero AND [Bairro] = @original_Bairro AND (([CEP] = @original_CEP) OR ([CEP] IS NULL AND @original_CEP IS NULL)) AND [IdCidade] = @original_IdCidade AND (([IdVia] = @original_IdVia) OR ([IdVia] IS NULL AND @original_IdVia IS NULL)) AND (([Complemento] = @original_Complemento) OR ([Complemento] IS NULL AND @original_Complemento IS NULL)) AND (([EnderecoCompleto] = @original_EnderecoCompleto) OR ([EnderecoCompleto] IS NULL AND @original_EnderecoCompleto IS NULL))" InsertCommand="INSERT INTO [EnderecoCorrida] ([Logradouro], [Numero], [Bairro], [CEP], [IdCidade], [IdVia], [Complemento], [EnderecoCompleto]) VALUES (@Logradouro, @Numero, @Bairro, @CEP, @IdCidade, @IdVia, @Complemento, @EnderecoCompleto)" OldValuesParameterFormatString="original_{0}" ProviderName="System.Data.SqlClient" SelectCommand="SELECT [Id], [Logradouro], [Numero], [Bairro], [CEP], [IdCidade], [IdVia], [Complemento], [EnderecoCompleto] FROM [EnderecoCorrida] WHERE ([Id] = @Id)" UpdateCommand="UPDATE [EnderecoCorrida] SET [Logradouro] = @Logradouro, [Numero] = @Numero, [Bairro] = @Bairro, [CEP] = @CEP, [IdCidade] = @IdCidade, [IdVia] = @IdVia, [Complemento] = @Complemento, [EnderecoCompleto] = @EnderecoCompleto WHERE [Id] = @original_Id AND [Logradouro] = @original_Logradouro AND [Numero] = @original_Numero AND [Bairro] = @original_Bairro AND (([CEP] = @original_CEP) OR ([CEP] IS NULL AND @original_CEP IS NULL)) AND [IdCidade] = @original_IdCidade AND (([IdVia] = @original_IdVia) OR ([IdVia] IS NULL AND @original_IdVia IS NULL)) AND (([Complemento] = @original_Complemento) OR ([Complemento] IS NULL AND @original_Complemento IS NULL)) AND (([EnderecoCompleto] = @original_EnderecoCompleto) OR ([EnderecoCompleto] IS NULL AND @original_EnderecoCompleto IS NULL))"&gt;
      &lt;DeleteParameters&gt;
          &lt;asp:Parameter Name="original_Id" Type="Int32" /&gt;
          &lt;asp:Parameter Name="original_Logradouro" Type="String" /&gt;
          &lt;asp:Parameter Name="original_Numero" Type="Int32" /&gt;
          &lt;asp:Parameter Name="original_Bairro" Type="String" /&gt;
          &lt;asp:Parameter Name="original_CEP" Type="String" /&gt;
          &lt;asp:Parameter Name="original_IdCidade" Type="Int32" /&gt;
          &lt;asp:Parameter Name="original_IdVia" Type="Int32" /&gt;
          &lt;asp:Parameter Name="original_Complemento" Type="String" /&gt;
          &lt;asp:Parameter Name="original_EnderecoCompleto" Type="String" /&gt;
      &lt;/DeleteParameters&gt;
      &lt;InsertParameters&gt;
          &lt;asp:Parameter Name="Logradouro" Type="String" /&gt;
          &lt;asp:Parameter Name="Numero" Type="Int32" /&gt;
          &lt;asp:Parameter Name="Bairro" Type="String" /&gt;
          &lt;asp:Parameter Name="CEP" Type="String" /&gt;
          &lt;asp:Parameter Name="IdCidade" Type="Int32" /&gt;
          &lt;asp:Parameter Name="IdVia" Type="Int32" /&gt;
          &lt;asp:Parameter Name="Complemento" Type="String" /&gt;
          &lt;asp:Parameter Name="EnderecoCompleto" Type="String" /&gt;
      &lt;/InsertParameters&gt;
      &lt;SelectParameters&gt;
          &lt;asp:QueryStringParameter Name="Id" QueryStringField="IdEnderecoCorrida" Type="Int32" /&gt;
      &lt;/SelectParameters&gt;
      &lt;UpdateParameters&gt;
          &lt;asp:Parameter Name="Logradouro" Type="String" /&gt;
          &lt;asp:Parameter Name="Numero" Type="Int32" /&gt;
          &lt;asp:Parameter Name="Bairro" Type="String" /&gt;
          &lt;asp:Parameter Name="CEP" Type="String" /&gt;
          &lt;asp:Parameter Name="IdCidade" Type="Int32" /&gt;
          &lt;asp:Parameter Name="IdVia" Type="Int32" /&gt;
          &lt;asp:Parameter Name="Complemento" Type="String" /&gt;
          &lt;asp:Parameter Name="EnderecoCompleto" Type="String" /&gt;
          &lt;asp:Parameter Name="original_Id" Type="Int32" /&gt;
          &lt;asp:Parameter Name="original_Logradouro" Type="String" /&gt;
          &lt;asp:Parameter Name="original_Numero" Type="Int32" /&gt;
          &lt;asp:Parameter Name="original_Bairro" Type="String" /&gt;
          &lt;asp:Parameter Name="original_CEP" Type="String" /&gt;
          &lt;asp:Parameter Name="original_IdCidade" Type="Int32" /&gt;
          &lt;asp:Parameter Name="original_IdVia" Type="Int32" /&gt;
          &lt;asp:Parameter Name="original_Complemento" Type="String" /&gt;
          &lt;asp:Parameter Name="original_EnderecoCompleto" Type="String" /&gt;
      &lt;/UpdateParameters&gt;
  
  &lt;/asp:SqlDataSource&gt;
  &lt;asp:DetailsView runat="server" ID="dvEnderecoCorrida" DataSourceID="sqlDataSourceEnderecoCorrida"&gt;
  
  &lt;/asp:DetailsView&gt;
  </code></pre>
  
  <p></p>
  
  <p>My Repeater Control havea few items, and i need to exchange data between my base form and my Popup. The button that shows the popup is btnAlterarOrigem, and there is an ID for each record that each ItemTemplate represents. I need to send to the popup info from which ItemTemplate opened the popup and show some data.</p>
  
  <p>How can i exchange information between them?</p>