Tags: aspx, below, capture, config, configure, defaultredirect, defaultredirectmycustompagehtm, display, error, gtcan, htm, ltcustomerrors, mode, moderemoteonly, mycustompage, net, remoteonly, server, web

<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>

On .Net » .Net Technology

1,223 words with 1 Comments; publish: Sat, 05 Jan 2008 04:37:00 GMT; (10093.75, « »)

If I configure Web.config as below :

<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>

Can I capture any server error to display on mycustompage.htm? How?

Thanks.

All Comments

Leave a comment...

  • 1 Comments
    • If I configure Web.config as below :

      <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>

      Can I capture any server error to display on mycustompage.htm? How?

      Not with that setting. You need to write code for displaying the stack trace onto an error page and redirect the browser to that error. You should handle the Application_Error handler in the Global.asax.cs class. Remember, all application error eventually bubbled upto the application, if not handled by a catch statement in your code. So, Application_Error handler knows all the errors that occur in the application, so thats the best place to put the code to catch the stacktrace from the exception

      #1; Sat, 05 Jan 2008 04:38:00 GMT