Hi I want to call javacript code that populates the parent window. In my aspx page I have an sqlDataSource followed by a DataList.
<asp:DataList runat="server" id="DataList1" DataSourceID="SqlDataSource2">
<ItemTemplate>
Id:
<asp:Label Text='<%# Eval("Id") %>' runat="server" id="IdLabel" />
<br />
CustomerName:
<asp:Label Text='<%# Eval("CustomerName") %>' runat="server" id="CustomerNameLabel" />
<br />
CustomerAddress:
<asp:Label Text='<%# Eval("CustomerAddress") %>' runat="server" id="CustomerAddressLabel" />
<br />
CustomerDOB:
<asp:Label Text='<%# Eval("CustomerDOB") %>' runat="server" id="CustomerDOBLabel" />
<br />
<br />
<input name="BtnSelect" type="button" value="Select" onclick="javascript:PopulateParent("<%# Eval("CustomerAddress") %> ");"/>
</ItemTemplate>
</asp:DataList>
when the button is pressed i want the values of CustomerName and CustomerAddress to be passed to my Javascript code. I've added the onclick to standard button within ItemTemplate but i recieve errors.
What’s the best way to do this, I dont necessarily need to use a DatList, also tried a GridView but still have a problem incorporating onclick.
onclick works without the server code bit i.e.