0

I have an ASP.NET 4.0 site that has links to another ASP.NET site (different domain name). In situations where users from domain 1 are directed to a page on domain 2, how would I setup a Javascript routine to create an href back to domain 1? That is, I don't want to place a solid <a> tag on domain 2 pointing back to domain 1. Rather, I need a little bit of script magic that only makes the href available to users coming from domain 1. Can anyone suggest a specific Javascript library/widget that functions in this manner?

1
  • 1
    document.referrer contains the URL the user came from. You could use that at domain 2 to decide whether or not to display a link. Commented Mar 16, 2011 at 22:04

1 Answer 1

1

Do you have to do this in javascript? You can use the Request.UrlReferrer in the asp.net page to see where the request came from and using that you can make the link.

Uri LastUrl = Request.UrlReferrer;
Sign up to request clarification or add additional context in comments.

1 Comment

This would be placed on the landing page on domain 2?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.