Back Button Problem
-
I have 2 Web Pages page1.aspx and page2.aspx. On page1.aspx i am selecting values fom list box and transfering to page2.aspx using Button -- "Select".This works fine. Suppose user doesn't select any value from list box then message box pops up to user ...code for messagebox is like this Private Sub btnHighlightYears_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHighlightYears.Click If Lstbox_Years.SelectedValue.ToString() = "" Then MessageBox.Show("Please Select Atleast One Year") Else Server.Transfer("Acct_Details.aspx?type=h") End If End Sub Message box is a class and using java script and other controls it is made - which looks similar like a windows based application message box. Now on page1.aspx i have one more button - "Select All and Continue".This also works fine and transfers me to page2.aspx Problem ======= When i first click on Button -- "Select" and nothing is selected fom list box then message box pops up ...click okay and then click button - "Select All and Continue" and it takes me to pafe2.aspx. When i returns back to page1.aspx through Back button if IE/browser , the message box again pops up. Is it an error or an issue...How can i solve this ? Please help me. Thanks,
-
I have 2 Web Pages page1.aspx and page2.aspx. On page1.aspx i am selecting values fom list box and transfering to page2.aspx using Button -- "Select".This works fine. Suppose user doesn't select any value from list box then message box pops up to user ...code for messagebox is like this Private Sub btnHighlightYears_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHighlightYears.Click If Lstbox_Years.SelectedValue.ToString() = "" Then MessageBox.Show("Please Select Atleast One Year") Else Server.Transfer("Acct_Details.aspx?type=h") End If End Sub Message box is a class and using java script and other controls it is made - which looks similar like a windows based application message box. Now on page1.aspx i have one more button - "Select All and Continue".This also works fine and transfers me to page2.aspx Problem ======= When i first click on Button -- "Select" and nothing is selected fom list box then message box pops up ...click okay and then click button - "Select All and Continue" and it takes me to pafe2.aspx. When i returns back to page1.aspx through Back button if IE/browser , the message box again pops up. Is it an error or an issue...How can i solve this ? Please help me. Thanks,
It pops up again because it is displaying the cached page that is in your history. I imagine the back button is similar to
javascript:history.go(-1);
I don't know if restricting the caching of the page will work or not, but i have a domain hosting control panel that always (seems to) re-request a page when i click the back button on the browser. This would be the result you are aiming for, then you can check server side if you want the message box code to be written into the page. g00fy