Last post Mar 19, 2006 10:09 PM by Konk
Mar 14, 2006 03:55 PM|lilon|LINK
I have a Master Detail module with the master on one page and the details on another. The master has a search button and a datagrid which displays the results. In the datagrid I have hyperlink in each row that sends the user if clicked to the Detail page,
where he can see the details in another datagrid, and add, edit, delete.
My problem is how to return from the detail page to the master and still get the last search results of the master displayed in the datagrid.
If I use Response.Redirect(NavigateURL(),true) I go back to the master page, but I dont get the search results in the datagrid.
Mar 14, 2006 11:31 PM|thecrispy1|LINK
You somehow need the parameters passed in the original master page to be returned to it from the detail page. This can be querystring, session, whatever you prefer. (I dislike session personally)
Mar 15, 2006 01:07 AM|lilon|LINK
thanks for your answer.
So does it mean that I have to pass to the detail page (in the session or querystring) all the search criteria (they could be many as I have about 15 text boxes and drop down lists as search criteria, with AND/OR options between each and every one of them)
Mar 19, 2006 10:09 PM|Konk|LINK
you have two options or workarounds that I can think of:
1. popup the details in a new browser window
or 2. if your detail page does not need to be refreshed (if the user added or deleted a record), you can use the browser history to go back as below:
In Initialize section, create a viewstate variable to count no. of Postbacks
viewstate.Add("PostBackCounter", 1) 'To count no. of Postbacks in order to return to caller
In Page_Load fn
If IsPostBack then
viewstate.Item("PostBackCounter") = viewstate.Item("PostBackCounter") + 1
Return or GoBack event
Private Sub pbCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles pbCancel.Click
Dim strScript As String
"window.history.go(-" & viewstate.Item("PostBackCounter") & ");" & _