Morning Mr.Mudassar.
I have used your code " Pass value from child popup window to parent page window using JavaScript"
I can open popup windows and it populate data into gridview. it is working fine. But I cannot pass the value to main windows which i have select from gridview. I capture the value from gridview into textbox and also I have a button to pass value to Main Window.
I am using Master page.
Pls Help me.
Thank you in advance
Maideen
Main Window.
<script type="text/javascript">
var popup;
function SelectItemDESC() {
popup = window.open("ProductSearch.aspx", "Popup", "width=800,height=400");
popup.focus();
}
</script>
Popup Windows
<body>
<form id="form1" runat="server">
<asp:Label ID="Label1" runat="server" Text="Select Item Name"></asp:Label>
<asp:TextBox ID="txtSearch" runat="server"></asp:TextBox>
<asp:Button ID="btnSearch" runat="server" Text="Search" />
<asp:TextBox ID="txtItemName" runat="server"></asp:TextBox>
<asp:Button ID="btnSelectItem" runat="server" Text="select Item" OnClientClick ="SetName();" />
<div>
<script type="text/javascript">
function SetName() {
if (window.opener != null && !window.opener.closed) {
var txtItemID = window.opener.document.getElementById("txtItemID");
txtItemID.value = document.getElementById("txtItemName").value;
}
window.close();
}
</script>
<br />
<asp:GridView ID="GridView1" runat="server" CssClass="gridview" AutoGenerateColumns="False" BackColor="White" BorderColor="#E7E7FF" BorderStyle="None"
BorderWidth="1px" CellPadding="3" GridLines="Horizontal" PageSize="15" Font-Names="Calibri" Font-Size="Small">
<AlternatingRowStyle BackColor="#F7F7F7" />
<Columns>
<asp:CommandField ShowSelectButton="True">
<ItemStyle Width="50px" />
</asp:CommandField>
<asp:BoundField DataField="id" InsertVisible="False" ReadOnly="True" SortExpression="id" Visible="true" HeaderText="ID"/>
<asp:BoundField DataField="itemid" HeaderText="Item Code"/>
<asp:BoundField DataField="itemdes" HeaderText="Description"/>
<asp:BoundField DataField="Category" HeaderText="Category"/>
<asp:BoundField DataField="uom" HeaderText="UOM"/>
<asp:BoundField DataField="Suppprice" HeaderText="SuppPrice"/>
<asp:BoundField DataField="taxcode" HeaderText="Tax Code"/>
</Columns>
<FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
<HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
<PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
<RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
<SortedAscendingCellStyle BackColor="#F4F4FD" />
<SortedAscendingHeaderStyle BackColor="#5A4C9D" />
<SortedDescendingCellStyle BackColor="#D8D8F0" />
<SortedDescendingHeaderStyle BackColor="#3E3277" />
</asp:GridView>
</div>
</form>
</body>