javascript - Exchange data between webform and popup(another webform inside IFrame) -
i have webform
<%@ page language="c#" autoeventwireup="true" codebehind="corridaexecutadacorridacompleta.aspx.cs" inherits="lightswitchapplication.webforms.corridaexecutadacorridacompleta" masterpagefile="~/mainprincipal.master" %> <%@ register assembly="ajaxcontroltoolkit" namespace="ajaxcontroltoolkit" tagprefix="aja" %> <asp:content contentplaceholderid="contentlinks" runat="server" id="contentlinks"> <link href="../bootstrap-3.2.0-dist/css/bootstrap.min.css" rel="stylesheet" /> <script src="../bootstrap-3.2.0-dist/js/bootstrap.min.js" type="text/javascript"></script> <script src="../jquery/jquery-2.1.1.min.js"></script> <asp:scriptmanager id="scriptmanager" runat="server"></asp:scriptmanager> </asp:content> <asp:content contentplaceholderid="contentbody" id="contentbody" runat="server"> <asp:panel id="panl1" runat="server" cssclass="popup" align="center" style="display: none"> <iframe style="width: 850px; height: 500px;" id="irm1" src="enderecocorridacorridaexecutadacompleta.aspx?idenderecocorrida=4201337" runat="server"></iframe> <br /> <asp:button id="btnclose" runat="server" text="fechar" /> </asp:panel> <div class="container"> <div class="row"> <div class="col-sm-8"> <asp:label runat="server" id="lblcorrida" text="corrida: "></asp:label> <asp:dropdownlist runat="server" id="ddcorridas" width="100%" datatextfield="nomecompletocorrida" datavaluefield="id"></asp:dropdownlist> </div> <div class="col-sm-4"> <asp:button runat="server" id="btnprocurar" text="procurar" class="btn btn-info btn-default" onclick="btnprocurar_click" /> </div> </div> <hr /> <div class="row"> <asp:repeater id="repmovimentoscorridaexecutada" runat="server" onitemdatabound="repmovimentoscorridaexecutada_itemdatabound"> <headertemplate> <div class="col-sm-6"> <asp:label runat="server" id="lblnomecorrida" text="nome da corrida: "></asp:label> </div> <div class="col-sm-12"> <asp:textbox runat="server" id="txbnomecorrida" text='<%# nomecorrida %>' width="100%"></asp:textbox> </div> <div class="col-sm-6"> <asp:label runat="server" id="lblmotorista" text="motorista: "></asp:label> </div> <div class="col-sm-12"> <asp:textbox runat="server" id="txbmotorista" readonly="true" text='<%# nomecompletomotorista %> ' width="100%"></asp:textbox> </div> <tr> <td colspan="6"> <hr /> </td> </tr> </headertemplate> <itemtemplate> <aja:modalpopupextender id="mp1" runat="server" popupcontrolid="panl1" targetcontrolid="btnalterarorigem" cancelcontrolid="btnclose" backgroundcssclass="background"> </aja:modalpopupextender> <div class="col-sm-4"> <div class="row"> <div class="col-sm-6"> <asp:label runat="server" id="lbltipomovimentocorridaexecutada" text="tipo de movimento:"></asp:label> </div> <div class="col-sm-12"> <asp:textbox runat="server" id="txbtipomovimentocorridaexecutada" text='<%# eval("nometipomovimentocorrida")%>' width="100%"></asp:textbox> </div> </div> <div class="row"> <div class="col-sm-6"> <asp:label runat="server" id="lblenderecocompleto" text="endereço completo:"></asp:label> </div> <div class="col-sm-12"> <asp:textbox runat="server" id="txbenderecoorigem" text='<%# eval("enderecoorigemcompleto")%>' width="100%" ></asp:textbox> <asp:button runat="server" id="btnalterarorigem" text="alterar" cssclass="btn btn-default btn-info" onclick="btnalterarorigem_click" /> </div> </div> <div class="row"> <div class="col-sm-6"> <asp:label runat="server" id="lblenderecodestino" text="endereço completo:"></asp:label> </div> <div class="col-sm-12"> <asp:textbox runat="server" id="txbenderecodestino" text='<%# eval("enderecoorigemcompleto")%>' width="100%"></asp:textbox> <asp:button runat="server" id="btnalterardestino" text="alterar" cssclass="btn btn-default btn-info"/> </div> </div> <div class="row"> <div class="col-sm-6"> <asp:label runat="server" id="lbldistanciaorigemdestino" text="distância em km:"></asp:label> </div> <div class="col-sm-12"> <asp:textbox runat="server" id="txbdistanciaorigemdestino" text='<%# eval("distanciaorigemdestino")%>' width="100%"></asp:textbox> </div> </div> <div class="row"> <div class="col-sm-6"> <asp:label runat="server" id="lbltempoorigemdestino" text="tempo em mins."></asp:label> </div> <div class="col-sm-12"> <asp:textbox runat="server" id="txbtempoorigemdestino" text='<%# eval("tempoorigemdestino")%>' width="100%"></asp:textbox> </div> </div> </div> </itemtemplate> </asp:repeater> </div> </div>
and second webform(the 1 opened popup)
<%@ page language="c#" autoeventwireup="true" codebehind="enderecocorridacorridaexecutadacompleta.aspx.cs" inherits="lightswitchapplication.webforms.enderecocorridacorridaexecutadacompleta" masterpagefile="~/mainprincipal.master" %> <asp:content contentplaceholderid="contentbody" runat="server"> <asp:sqldatasource runat="server" id="sqldatasourceenderecocorrida" connectionstring="<%$ connectionstrings:sossemtempodata %>" conflictdetection="compareallvalues" deletecommand="delete [enderecocorrida] [id] = @original_id , [logradouro] = @original_logradouro , [numero] = @original_numero , [bairro] = @original_bairro , (([cep] = @original_cep) or ([cep] null , @original_cep null)) , [idcidade] = @original_idcidade , (([idvia] = @original_idvia) or ([idvia] null , @original_idvia null)) , (([complemento] = @original_complemento) or ([complemento] null , @original_complemento null)) , (([enderecocompleto] = @original_enderecocompleto) or ([enderecocompleto] null , @original_enderecocompleto null))" insertcommand="insert [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] [enderecocorrida] ([id] = @id)" updatecommand="update [enderecocorrida] set [logradouro] = @logradouro, [numero] = @numero, [bairro] = @bairro, [cep] = @cep, [idcidade] = @idcidade, [idvia] = @idvia, [complemento] = @complemento, [enderecocompleto] = @enderecocompleto [id] = @original_id , [logradouro] = @original_logradouro , [numero] = @original_numero , [bairro] = @original_bairro , (([cep] = @original_cep) or ([cep] null , @original_cep null)) , [idcidade] = @original_idcidade , (([idvia] = @original_idvia) or ([idvia] null , @original_idvia null)) , (([complemento] = @original_complemento) or ([complemento] null , @original_complemento null)) , (([enderecocompleto] = @original_enderecocompleto) or ([enderecocompleto] null , @original_enderecocompleto null))"> <deleteparameters> <asp:parameter name="original_id" type="int32" /> <asp:parameter name="original_logradouro" type="string" /> <asp:parameter name="original_numero" type="int32" /> <asp:parameter name="original_bairro" type="string" /> <asp:parameter name="original_cep" type="string" /> <asp:parameter name="original_idcidade" type="int32" /> <asp:parameter name="original_idvia" type="int32" /> <asp:parameter name="original_complemento" type="string" /> <asp:parameter name="original_enderecocompleto" type="string" /> </deleteparameters> <insertparameters> <asp:parameter name="logradouro" type="string" /> <asp:parameter name="numero" type="int32" /> <asp:parameter name="bairro" type="string" /> <asp:parameter name="cep" type="string" /> <asp:parameter name="idcidade" type="int32" /> <asp:parameter name="idvia" type="int32" /> <asp:parameter name="complemento" type="string" /> <asp:parameter name="enderecocompleto" type="string" /> </insertparameters> <selectparameters> <asp:querystringparameter name="id" querystringfield="idenderecocorrida" type="int32" /> </selectparameters> <updateparameters> <asp:parameter name="logradouro" type="string" /> <asp:parameter name="numero" type="int32" /> <asp:parameter name="bairro" type="string" /> <asp:parameter name="cep" type="string" /> <asp:parameter name="idcidade" type="int32" /> <asp:parameter name="idvia" type="int32" /> <asp:parameter name="complemento" type="string" /> <asp:parameter name="enderecocompleto" type="string" /> <asp:parameter name="original_id" type="int32" /> <asp:parameter name="original_logradouro" type="string" /> <asp:parameter name="original_numero" type="int32" /> <asp:parameter name="original_bairro" type="string" /> <asp:parameter name="original_cep" type="string" /> <asp:parameter name="original_idcidade" type="int32" /> <asp:parameter name="original_idvia" type="int32" /> <asp:parameter name="original_complemento" type="string" /> <asp:parameter name="original_enderecocompleto" type="string" /> </updateparameters> </asp:sqldatasource> <asp:detailsview runat="server" id="dvenderecocorrida" datasourceid="sqldatasourceenderecocorrida"> </asp:detailsview>
my repeater control havea few items, , need exchange data between base form , popup. button shows popup btnalterarorigem, , there id each record each itemtemplate represents. need send popup info itemtemplate opened popup , show data.
how can exchange information between them?
Comments
Post a Comment