Problem :
Let us think of a scenario :
Suppose we have a search page (A.aspx) which contains a tabular view of student data . The page contains a filter button to filter the students based on some condition . Initially the table contains all students data (say 100 records) . Now after pressing the filter button,the table has now only 25 records .
Again for each student row, we have a link to open its details where we can view/edit the student information. These are very common work we are doing for records management.
Now after editing the student details from popup, we always want to refresh the parent page to reflect the changes for that student. For this we can use the following scripts in window.onunload event :
window.opener.location.href = window.opener.location.href;
window.opener.location.reload();
The problems with the above scripts are :
1) Every time when we close the child window, whether we have modified the student's data or not, the parent page will be refreshed.
2) If the page refreshes, our searched records(25 records) will be lost and display back to default dataset of 100 records of the students.
Generally we are doing following things to get back the searched results after closing the child window
--> storing the filter values in cookies, sessions, hidden fields, or pass to and fro through the query string between the parent and child pages. Which causes overhead and hence performance is affected .