Error Pages

OpenWaves.Templates.Errors package provides you custom aspx pages to override default ASP .NET behaviour and display simple message to end user. You can also change content of these pages in your project. By default you will have pages for 404 and 500 http error code:
/Templates/Pages/Error404.aspx
/Templates/Pages/Error500.aspx

Usage example

To use these pages you have to modify your web.config file like following:
<configuration>
  <system.web>
    <customErrors redirectMode="ResponseRewrite" mode="RemoteOnly">
      <error statusCode="404" redirect="/Templates/Pages/Error404.aspx" />
      <error statusCode="500" redirect="/Templates/Pages/Error500.aspx" />
    </customErrors>
  </system.web>
  <!--IIS 7.0-->
  <system.webServer>
    <httpErrors errorMode="DetailedLocalOnly" existingResponse="Replace">
      <remove statusCode="404" subStatusCode="-1"/>
      <remove statusCode="500" subStatusCode="-1"/>
      <error statusCode="404" path="/Templates/Pages/Error404.aspx" responseMode="ExecuteURL" />
      <error statusCode="500" path="/Templates/Pages/Error500.aspx" responseMode="ExecuteURL" />
    </httpErrors>
  </system.webServer>
</configuration>
This configuration contains required elements for IIS 7.0 version and previous releases.
Your web.config file will be modified during package installation by NuGet. If you already have customErrors or httpErrors element, it will be disabled but still available to edit.

Last edited Jan 25, 2013 at 1:34 PM by piotrdela, version 6

Comments

No comments yet.