mdProgrammer
Programmer
I have a search page in my application where the user enters one or more search options, and displays a datagrid. I put a "view detail" button which will pop up another page (using javascript) that shows a read-only version of the add/edit screen. Session("sqlDBSearch") gets a datatable with the current SQL string in the form. (for example, it may show 7 records)
This opens up the readonly window fine, with a navigation control I created (first/prev/next/last). Form #1 might show "3 of 7 Records".
Here's where it goes wrong. I go back to the search form, and enter another search which displays a different result. (i.e., 2 records), and the 2nd popup form will show "2 of 2 records". The problem is that on the first popup, if I select any navigation button, it shows "2 of 2". So, the session variable is being overwritten. I also tried ViewState, which didn't work, and I don't think Application would do the trick, either. This is the code that is in my page load (inside of a if not ispostback statement) if the request.querystring "search" keyword is there.
Is there a way that I can keep the datatable session or viewstate unique to that page?
Code:
Session("sqlDBSearch") = dbClass.getDataTable(SQL.tostring)
msg.Text = "<script>window.open('default.aspx?search=readonly,'','dialogWidth:780px;dialogHeight:494px;status=no;scrollbars=no');</script>"
This opens up the readonly window fine, with a navigation control I created (first/prev/next/last). Form #1 might show "3 of 7 Records".
Here's where it goes wrong. I go back to the search form, and enter another search which displays a different result. (i.e., 2 records), and the 2nd popup form will show "2 of 2 records". The problem is that on the first popup, if I select any navigation button, it shows "2 of 2". So, the session variable is being overwritten. I also tried ViewState, which didn't work, and I don't think Application would do the trick, either. This is the code that is in my page load (inside of a if not ispostback statement) if the request.querystring "search" keyword is there.
Code:
ViewState("sqlDBSearch") = Session("sqlDBSearch")
populateSearchFields(ViewState("sqlDBSearch"), 0) '0 is the 1st record
Is there a way that I can keep the datatable session or viewstate unique to that page?