[Fix]-customErrors mode=RemoteOnly defaultRedirect=mycustompage.htm
Scenario:
Web.config is configured as shown below :
<customErrors mode="RemoteOnly" defaultRedirect = "wikitechysample.htm"/>
Unable to capture server error on wikitechysample.htm
Error:
customErrors mode=RemoteOnly defaultRedirect= wikitechysample.htm
Fix:
- Write code to print stack trace in an error page.
- Redirect the browser to load the error page.
- Handle Application_Error handler in the Global.asax.cs class file as the Application_Error handler detects all the errors that occur in the application, even if they are not catched with try catch blocks.