Jan
Jan

Reputation: 97

Close pop up panel in javascript

I wanted to close the pop up gridview in asp panel ID="pnlPopup" and inside the panel got the gridview of ID="MultiSelectGridView1". I tried to close the pop up panel after put the selected value in textbox in parent page. But it return close all the window including parent page. Hope help.

<script type="text/javascript">
            function setSearch(row) {
                var tbl = document.getElementById("<%=MultiSelectGridView1.ClientID%>");
                var txt = document.getElementById("<%=txtName.ClientID%>");
                txt.value = tbl.rows[row + 1].cells[1].innerText;
                window.close(<%=pnlPopup.ClientID%>);

            }
          </script>

Upvotes: 1

Views: 143

Answers (1)

Nizar Ahammed
Nizar Ahammed

Reputation: 99

Just use as below:

document.getElementById("<%= pnlPopup.ClientID %>").style.display = "none";

Upvotes: 1

Related Questions