Code

ASP.NET Core Find out Page Referer

Kontext Kontext visibility 809 comment 0 access_time 2 years ago language English

descriptionCode description

Referer is usually sent as part of HTTP request headers. For instance, the Referer field in HTTP request header can look like the following:

Referer: https://kontext.tech/

This code snippet provides example of retrieving referer information via HttpRequest.GetTypedHeaders method in ASP.NET Core Razor pages. It also shows you how to get the relative path and query string only. The same code can also be used in web API controllers.

Note: The referer can be NULL if user directly type the page URL in browser. 

fork_rightFork
more_vert
copyright This page is subject to Site terms.
comment Comments
No comments yet.

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts