This error is appearing because you are encountering some problem in your application. You can change this in Web.Config
. It has a tag that calls customErrors
, put her as Off
.
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Remembering that you have to do the error handling. My suggestion is you create an error page that redirects the user whenever any unexpected error occurs. For this, you use the tag customErrors
and defines a page in the defaultRedirect
. You can treat each error with a page. For example a common error is the "HTTP 404 Page Not Found", you can use the
statusCode
tag error
. Another useful parameter is the mode
that you define which errors will 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 appears. When running remotely, you will be redirected.
Off
: The error will always be displayed.
Some statusCode
:
- 404: Page not found (File not found)
- 403: Access denied (Access denied)
- 500: Server error (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
The site had these redirects that you told me about, but still displayed error when adding points to the end of the URL. The error was not caught even by default redirect. I found the solution, I will put below.
– Lara