Hi, I am trying to redirect if the answer is 404, but it does not work as expected, can you see this problem? It still refers to a total of 404
in my Global.asax
protected void Application_BeginRequest(Object sender, EventArgs e)
{
if (Response.Status == "404 Not Found")
{
string notFound = "~/custom_notfound.aspx";
Response.Redirect(notFound);
}
}
UPDATE
Tried so far
(Response.Status == "404 Not Found")
(Response.Status == "404")
(Response.StatusCode == 404)
source
share