Custom error handling Asp .Net

Posted by lidermin on Stack Overflow See other posts from Stack Overflow or by lidermin
Published on 2010-03-18T18:29:15Z Indexed on 2010/03/18 18:31 UTC
Read the original article Hit count: 420

Filed under:

Hi, I have a doubt:

On my web application, I had configured my web.config file to set customerrors to ON, so here it is:

<customErrors mode="On" defaultRedirect="Error.aspx">
    <error statusCode="403" redirect="Error.aspx" />
    <error statusCode="404" redirect="Error.aspx" />
  </customErrors>

For explaining propouses I only captured the 403 and 404 error (and the defaultRedirect obviouly). But I would like to get more details of the error on the page: Error.aspx somehow; but not creating each page for each kind of error. Is there a way to include certain code on my error page (Error.aspx) to get the detail of what raised that error?.

Hope myself clear. Thanks

PD. I'm using C#.

© Stack Overflow or respective owner

Custom error handling Asp .Net

Posted by lidermin on Stack Overflow See other posts from Stack Overflow or by lidermin
Published on 2010-03-18T18:29:37Z Indexed on 2010/03/18 18:31 UTC
Read the original article Hit count: 420

Filed under:

Hi, I have a doubt:

On my web application, I had configured my web.config file to set customerrors to ON, so here it is:

<customErrors mode="On" defaultRedirect="Error.aspx">
    <error statusCode="403" redirect="Error.aspx" />
    <error statusCode="404" redirect="Error.aspx" />
  </customErrors>

For explaining propouses I only captured the 403 and 404 error (and the defaultRedirect obviouly). But I would like to get more details of the error on the page: Error.aspx somehow; but not creating each page for each kind of error. Is there a way to include certain code on my error page (Error.aspx) to get the detail of what raised that error?.

Hope myself clear. Thanks

PD. I'm using C#.

© Stack Overflow or respective owner

Related posts about error-message