Error Helper

Last Updated 3/3/2015
Crete a custom error page

Creating an Error Page

Any website can have a custom error page. Simply create a page on the site with error as the friendly.  You can then view your error page at /error.


Add the BRT.DisplayError helper to the error page to display the error message to the viewer.  This will display the default error message for the error that occurred.

Default Message Not Your Thing?

Build a custom message based on the error. Use the @Response.StatusCode() and @Response.StatusDescription to customize your page based on the error.

@switch(Response.StatusCode) {
    case 404:
        <h1>Where did it go?</h1>
        <div>We had a page here, really we did.  Maybe we can tempt you to look for another?</div>
        <div><a href="/search">Try again</a></div>

    case 500:
        <h1>What Happened?</h1>
        <div>Wow, we really blew it. That page just blew up!</div>
        <div><a href="/search">Let's try again</a></div>


Article Topics

For Developers

Want to learn more?

Call 800-924-5220 or

Schedule a demo