22 [Fix]-customErrors mode=RemoteOnly defaultRedirect=mycustompage.htm - wikitechy.com

[Fix]-customErrors mode=RemoteOnly defaultRedirect=mycustompage.htm

Wikitechy | 7145 Views | asp.net | 28 May 2016

 

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.




Workshop

Bug Bounty
Webinar

Join our Community

Advertise
<