Search code examples
c#asp.netasp.net-mvcrequestfiltering

ASP.NET MVC can I add Request filter to track previous page?


I have ASP.NET MVC Project and I have some pages (let's call it Destination Page) that I can access from multiple pages. So I want to track which page redirects to Destination Page so I can return to it again. I red about Request Filters .. Can I use it in my case? Thanks in advance :)


Solution

  • URL Referrer is only populated by an actual client-click (anchor tag, button).

    Not when you manually put it in the URL (which is what my JavaScript is doing).

    The solution i am doing to have to with is to create a cookie on the whatever.aspx page, and read that cookie from the JavaScript before i redirect again.