D
DougS
I have an ASP.Net app and I'm trying to prevent the user from hitting the
back button to get back to page2.aspx from page3.aspx. I put this code in
page_init, page_load and page_prerender and it never fires except when I'm
coming into the page or posting back. When I go 'back' to the page it never
fires.
Dim sLastPage As String = Request.ServerVariables("HTTP_REFERER")
If sLastPage.IndexOf("Page1.aspx") < 5 And
sLastPage.IndexOf("Page2.aspx") < 1 Then
' if they did not come from Page1 or Page2 then send
' them back to where they came from
Response.Redirect(Request.ServerVariables("HTTP_REFERER"))
End If
Thanks for any help,
DougS
back button to get back to page2.aspx from page3.aspx. I put this code in
page_init, page_load and page_prerender and it never fires except when I'm
coming into the page or posting back. When I go 'back' to the page it never
fires.
Dim sLastPage As String = Request.ServerVariables("HTTP_REFERER")
If sLastPage.IndexOf("Page1.aspx") < 5 And
sLastPage.IndexOf("Page2.aspx") < 1 Then
' if they did not come from Page1 or Page2 then send
' them back to where they came from
Response.Redirect(Request.ServerVariables("HTTP_REFERER"))
End If
Thanks for any help,
DougS