I have created a cusom error page in ASP.NET 4.6 to display error message.
I get the exception details as below and store in a session variable in Application_Error section of Global.asax.cs
Exception exception = HttpContext.Current.Server.GetLastError().GetBaseException();
The page displays error message when called from Global.asax.cs but when I redeirect from web.config with custom error mode as on, error message is not displayed in the page.
Please advise.