Reputation: 1143
I have an ASP.Net application which generates short url for sharing. I want to track the url from where (source) click occured when it hits my asp.net page. I tried using Context.Request.UrlReferrer.AbsoluteUri but all I get from it is null.
Any ideas?
TIA
Upvotes: 1
Views: 1886
Reputation: 3232
Don't forget that the referrer will sometimes be null for things like search engines, or people behind corporate firewalls that remove some HTTP headers.
Upvotes: 1
Reputation: 7253
Not quite as clean, but you could use Request.Headers["Referer"]. Should be the same as using Context.Request, but I've found the behavior to be different.
Upvotes: 0