Rediret from global.asax under medium trust
-
23-08-2019 - |
Question
I have this simple Application_Error method in my global.asax, and it does not redirect in case an exception occurs under medium trust. Can someone tell me whats wrong here.
This code works fine under full trust
void Application_Error(object sender, EventArgs e)
{
Response.Redirect("~/error.aspx",false);
}
Solution
Apparently removing the false argument fixed this. It does generate a security exception when the redirect executes, but it redirects just fine
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow