Nota: Este artigo foi publicado originalmente em 2009. Alguns passos, comandos ou versões de software podem ter mudado. Consulte a documentação atual de .Net para as informações mais recentes.

Pré-requisitos

Antes de começar, certifique-se de ter:

  • Visual Studio or .NET CLI installed
  • .NET Framework or .NET Core SDK
  • Basic C# programming knowledge

How can you create custom error pages on an ASP.Net application so that you can better control the user experience when the unexpected happens? A: There is a configuration parameter in the Web.Config you can use to control what error pages the user sees:

This section of the web.config has to be placed in the following structure:


(<http://msdn.microsoft.com/en-us/library/5x77e536.aspx>)
  (<http://msdn.microsoft.com/en-us/library/dayb112d.aspx>)
    (<http://msdn.microsoft.com/en-us/library/y123fsf7.aspx>)


You can obtain more information on how to set this up by visiting the MSDN website. Here is an example obtained from there:

<system.web> </system.web>

Resumo

You’ve successfully learned how do you display custom error pages on an asp.net application?. If you run into any issues, double-check the prerequisites and ensure your .Net environment is properly configured.

Artigos Relacionados