-2

I've been finding a code in C# asp.net for a 404 error how do I create a 404 error that works significantly everytime whenever a page does not exist?

Moosa Zaidi
  • 21
  • 2
  • 5

1 Answers1

1

create your custome 404.aspx page and you have to put this in your web config before the final configuration tag

<configuration>
  <system.web>

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

  </system.web>
</configuration>

that's all :)