Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

get referrer UseStatusCodePagesWithRedirects

$
0
0

When a user goes to a non existing page, I refer to the standard login page :

public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{

app.UseStatusCodePagesWithRedirects("/online/?statusCode={0}");

...

On that page, I pass a message depending on the statuscode. However, I would like to show the URL of the page that created the error.
I tried Request.Headers["Referer"].ToString(), but that is empty. Is there a way to get the referrer?

Thanks

Pieter


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>