Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
XML
Hi, I am not sure if this can be done, I have searched many posts but can't find exactly what I am looking for, first trying this. I know I can post values from a textbox from a pop up to a textbox on a parent page. If I have a gridview on the parent page with a textbox in the footer. When I enter information into the popup textbox, is it possible for that value to get posted into the gridview's footer textbox on the parent page? If this is possible how can I achieve this? My code is below:

Parent gridview:

<asp:GridView ID="ProductsInCategory" runat="server" ShowFooter="True"
AutoGenerateColumns="False"
ShowHeaderWhenEmpty="True" DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="name"
HeaderText="stock_name" SortExpression="name">
</asp:BoundField>
<asp:BoundField DataField="id"
HeaderText="isin" SortExpression="id">
</asp:BoundField>
<asp:TemplateField>
<FooterTemplate>
<asp:Label ID="lblShipping" runat="server" Text="Shipping" />
<asp:TextBox ID="txtShipping" runat="server" />
</FooterTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:MyConnectionString %>" SelectCommand="SELECT * FROM Test_tbl
"></asp:SqlDataSource>

Child:

<head runat="server">
<title></title>
<script type="text/javascript">
window.history.forward(1);

function f2() {

opener.document.getElementById("TextBox2").value = document.getElementById('<%=txtNotes.ClientID%>').value;
opener.document.getElementById("txtShipping").value = document.getElementById('<%=txtNotes.ClientID%>').value;
window.close();
}
// function f2() {

// opener.document.getElementById("lblID").value = document.getElementById('<%=txtNotes.ClientID%>').value;
// window.close();
// }
</script>
</head>
<body>
<form id="form1" runat="server">
<div>

<asp:Button ID="cmdSave" runat="server" onclick="cmdSave_Click" Text="Save" />

<input type="button" value="close" onclick="f2();" />
<br />
<br />
<asp:TextBox ID="txtNotes" runat="server" Height="140px" TextMode="MultiLine"
Width="240px"></asp:TextBox>

</div>
</form>
</body>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900