Is there any way to know the previous page a user visited (on my site of course) from server side? I know I can do it if user was redirected before with Transfer() method. Does any history exist during session?
Asked
Active
Viewed 822 times
3
-
4maybe from the Referer in the request headers? But than can be faked.... – rene Dec 27 '12 at 20:28
2 Answers
4
You can use http://msdn.microsoft.com/en-us/library/system.web.httprequest.urlreferrer.aspx to get previous user client page.

Yuriy Galanter
- 38,833
- 15
- 69
- 136
-
1Note that `UrlReferrer` is not reliable - it may be `null` or it may be inaccurate. – John Saunders Dec 27 '12 at 21:43
1
Is the page that you looking for inside your own site? If so, you can do this to enable different reactions for different pages. If it is outside of your site, then I would go with UrlReferrer like Trekstuff mentioned.
If Not PreviousPage Is Nothing Then
Dim str As String = PreviousPage.AppRelativeVirtualPath
If str = "~/(DESIRED URL)" Then
End If
End IF

illinoistim
- 456
- 10
- 27