سؤال

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?

هل كانت مفيدة؟

المحلول

نصائح أخرى

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
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top