Get the previous page (the requested page)

  • Thread starter Thread starter Anavim
  • Start date Start date
A

Anavim

Hi,

I'm looking for a way to get the previous page that the user visit
before the current page (I can't use the back button with java
script).

Anyone knows how to do this?

I find out that in the application_beginrequest you can get the source
page, but the problem is that I don't have any place to store it (you
don't have access to the session object in application events.

Thanks.
 
Here is a really "cheap" way to accomplish it.

1. Create two session variables
a) CurrentPage
b) PreviousPage
2. When a page is hit, check if CurrentPage already has a value. If so, move
to previous page and then store the current page in CurrentPage

You can then use the Session["PreviousPage"] value to surf back.

I am certain there is a better way to accomplish this, but it is not popping
to mind at the current time.


---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
Hello Cowboy (Gregory A. Beamer) - MVP,
I am certain there is a better way to accomplish this, but it is not
popping to mind at the current time.

How about Request.UrlReferrer? :)
 
Back
Top