4

How to get previous page URL from IE c#..

Request.UrlReferrer" not working in IE

Please help...

Regon
  • 392
  • 1
  • 4
  • 17
Shivi
  • 1,075
  • 9
  • 24
  • 42
  • 2
    How to ask a good question: http://msmvps.com/blogs/jon_skeet/archive/2010/08/29/writing-the-perfect-question.aspx – Oded Aug 05 '11 at 10:02
  • Have you tried `Page.PreviousPage` ? –  Aug 05 '11 at 10:14
  • I would suggest looking for another way to do whatever you're trying to do. Aside from anything where the user was last is none of your business. – Michael Shimmins Aug 05 '11 at 10:43

2 Answers2

6

Try Request.ServerVariables["HTTP_REFERER"]

But Request.UrlReferrer gets his data there too, so if the value isn't set in that variable, there is no way to get it.

And it should work fine in IE..

Nagaraj S
  • 13,316
  • 6
  • 32
  • 53
Filip Cornelissen
  • 3,682
  • 3
  • 31
  • 41
0

Browsers don't always send the referrer, so you can't rely on having access to that information.

See the answer for Does http-equiv="refresh" keep referrer info and metadata?

Community
  • 1
  • 1
C.Evenhuis
  • 25,996
  • 2
  • 58
  • 72