Chuck Le Butt Chuck Le Butt - 1 year ago 151
HTTP Question

Getting the HTTP Referrer in ASP.NET

I'm looking for a quick, easy and reliable way of getting the browser's HTTP Referrer in ASP.Net (C#). I know the HTTP Referrer itself is unreliable, but I do want a reliable way of getting the referrer if it is present.

Answer Source

You could use the UrlReferrer property of the current request:


This will read the Referer HTTP header from the request which may or may not be supplied by the client (user agent).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download