This error is appearing because you are encountering a problem with your application. You can change this in Web.Config
. It has a tag that calls customErrors
, put it as Off
.
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Remembering that you have to deal with errors. My suggestion is you create an error page that redirects the user whenever an unexpected error occurs. For this, you use the customErrors
tag and set a page in defaultRedirect
. You can handle every mistake with a page. For example a common error is the "HTTP 404 Page Not Found", you can use the
statusCode
of tag error
. Another useful parameter is mode
that defines which errors are going to be displayed to the user. There are 3 values:
-
On
: Any error will be redirected to the defined page.
-
RemoteOnly
: When you are running the local application, the error will be displayed. When running remotely, it will be redirected.
-
Off
: The error will always be displayed.
Some statusCode
:
- 404: Page not found (File not found)
- 403: Access denied
- 500: Server Error
An example of Web.Config
:
<configuration>
<system.web>
<customErrors mode="On" defaultRedirect="pagErro.aspx">
<error statusCode="404" redirect="pagNaoEncontrada.aspx" />
</customErrors>
</system.web>
</configuration>
Documentation