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 query returns, creates a gridview where each record contains a link that will return the data to a java script. My problem is that I can not put 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>