1
I have a form containing a button that will open a query popup. In this popup, I make a query passing as parameters name and Cpf where the return of the query, creates a gridview where each record contains a link that will return the data to a java script. My problem is that I cannot place a link inside the grid by passing the parameters.
Below my grid and the javascript function call:
<asp:GridView ID="gvwPES" runat="server" AutoGenerateColumns="False" DataKeyNames="PES_ID" AllowPaging="True" AllowSorting="true" PageSize="10" OnPageIndexChanging="gvwPES_PageIndexChanging" CssClass="table table-bordered table-hover table-striped">
<Columns>
<asp:TemplateField HeaderText="Cod." Visible="False">
<ItemTemplate><%#Eval("PES_ID") %> </ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<itemtemplate>
<%#Eval("PES_NM") %>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Button ID="Enviar" runat="server" OnClick="javascript:informa_pessoa(<%#Eval("PES_ID") %>,<%#Eval("PES_NM") %>,<%#Eval("PES_DOCID") %>,
<%#Eval("PES_END") %>,<%#Eval("PES_CEP") %>,<%#Eval("PES_CID") %>,
<%#Eval("PES_UF") %>,<%#Eval("PES_FON") %>,<%#Eval("PES_FAX") %>,
<%#Eval("PES_INSCE") %>,<%#Eval("PES_INSCM") %>,<%#Eval("PES_BAI") %>,
<%#Eval("PES_DOC_IDENT") %>,<%#Eval("CON_ID") %>,<%#Eval("CON_NM") %>,
<%#Eval("PES_TP") %>,<%#Eval("PES_NUM_END") %>,<%#Eval("PES_COMPLEMENTO")%>,
<%#Eval("TCP_TP_LOGR") %>,<%#Eval("PES_TP_APR") %>,<%#Eval("SUS_LIM") %>,
<%#Eval("SUS_DT") %>,<%#Eval("PES_INST_PROT") %>)" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<PagerSettings Mode="NextPrevious" NextPageText="Próximo" PreviousPageText="Anterior" />
</asp:GridView>
Java script:
<script type="text/javascript">
function informa_pessoa(parametros da popup...) {
Código da popup...
window.close();
}
</script>
Avoid long discussions in the comments; this conversation was moved to the chat
– bfavaretto
@bfavaretto It is that he did not have enough scores to participate in the chat, so this is the only way I can try to help him. Anyway thanks for the "cleaning".
– Maicon Carraro
@Maiconcarraro, I did what you said, and I gave to make the conversions perfectly. But he is not passing the data from the child page to the parent page. This query form is a popup. Can I use the javascript method self.opener.Document? and if I set the parameters with the same name that is received in Function, it already takes automatic?
– Germano Sampaio
Would not be
window.opener.document
?– Maicon Carraro
is the self.opener itself!
– Germano Sampaio
@Maiconcarraro I passed the function call as you commented in the chat as follows: Page.ClientScript.Registerclientscriptblock(this.Gettype(), "informa_pessoa", parameters, true); where returned string <script>informa_pessoa(4, 204058, FRANCISCA GERMANO DOS SANTOS SANTIAGO , 78288002315,'',''',''',''',''',''',''','', 0,', 002,'',''''', 24,''', 0,'', 0)"</script> where the following error returns: Syntaxerror: Missing ) after list argument argument.
– Germano Sampaio
you need to have the parameters between simple quotes '' if it will not give problem type in FRANCISCA GERMANO
– Maicon Carraro
@Maiconcarraro, that’s right. Just one more thing. When you open a popup, because all I do in it like open a grid, it opens in a new window?
– Germano Sampaio
I couldn’t quite understand your question, you don’t want to open another question with this?
– Maicon Carraro
And if you solved your problem in this question, please mark as the right answer :)
– Maicon Carraro
Blz... thanks for the help!
– Germano Sampaio