<script type="text/javascript"> var popup; function SelectItemDESC() { popup = window.open("ProductSearch.aspx", "Popup", "width=800,height=400"); popup.focus(); return false; } </script>
<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="setValues()" /> <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(); } function SendValue(val) { window.opener.document.getElementById("txtItemID").value = val; window.close(); } function setValues() { //popup window element value var txt = document.getElementById("txtItemName").value; //parent window element to set value as window.opener.document.getElementById("txtItemID").value = txt; self.close(); return false; } </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>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)