0

I'm going off this: How do I get the referrer URL in an ASP.NET MVC action?

It works. I am recieving a URL when my form is submitted, but it's the same URL the contact form is on. I'm guessing when I hit submit, it thinks the previous page is the contact page. I'd like to find out the page the user was on BEFORE the contact form page.

This is what I have:

sb.Append("<p>Referrer URL: " + Request.ServerVariables["HTTP_REFERER"] + "</p>");
Community
  • 1
  • 1

1 Answers1

2

You could store the Referer in a hidden field in the form:

<input type="hidden" name="referer" value="<%=Request.ServerVariables["HTTP_REFERER"] %>" />
Sebastian Brand
  • 548
  • 4
  • 10