asp.net - How to Add an HREF using Javascript? -


I have an ASP.NET 4.0 site which is linked to another ASP.Net site (separate domain name). In situations where domain 1 users are directed to a page on domain 2, how do I set up a JavaScript routine to create an href back on domain 1? That is, I returned to domain 2 a solid and lt; A & gt; I do not want to tag 1. Instead, I need a little script magic which only provides href to users coming from 1 domain. Can a specific JavaScript Library / Widget suggest that works in this way?

Do you want to do this in JavaScript? You can use Request.UrlReferrer in the asp.net page to see where the request came from and used that you can create a link.

  Uri LastUrl = Request.UrlReferrer;    

Comments