button click firing on back button?

Greg.NET

Active member
Joined
Jun 4, 2007
Messages
27
Programming Experience
1-3
from the main web page you can select a report and view it in another window.

however if I visit another part of the site after doing this, and the user hits the browser's back button, the report opens up again!

Does anyone know why this is happening and what I can do to prevent this?

below is the code that handles the button click which launches a seperate window for the report:

VB.NET:
Protected Sub btn_openReport1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_openReport1.Click

                Dim rpt_name = Me.cbo_selectReport2.SelectedItem.Text
                Response.Write("<script>window.open('Reports/" & rpt_name & ".aspx','','status=1,toolbar=1,location=1,menubar=1,directories=1,resizable=1,scrollbars=1,height=window.height,width=window.width');</script>")
end sub
 
alright what I ended up doing is creating a hidden field to indicate if the report has already been open. If anyone has a more elegant solution I'd love to know because I use hidden fields way too much!
 
Back
Top