Displaying Gentle Error Messages with ASP.NET

Sign in to queue

The Discussion

  • User profile image
    Kit West

    The gentle message is definitely nicer than the angry one, but if there's truly a fault in the site, I'd like to know about it as a developer, not show it to users. We display something generic like, "An error was encountered and logged, and the operation was canceled -- sorry for the inconvenience. Please contact IT if this causes an urgent problem. Thank you." I get the user id, date/time, stack trace, along with parameter values and other context info, from my database (more accessible than system log).

  • User profile image
    wenchingchua

    That is really interesting. Thanks for sharing Smiley I never think of having sounds than showing nice messages Tongue Out

  • User profile image
    Robert McLaws

    This is really cool, but why not make it an item template, instead of a project template? If you've already got a project starting from the ASP.NET AJAX project, the download doesn't help much.

    But this is cool, thanks!

  • User profile image
    anushka K Rajasingha

    That is really interesting. Thanks for sharing

  • User profile image
    Meenakshi Dhar

    The download link is not working.. Can anybody please tell me from where I can download this example...

  • User profile image
    Justas Birgiolas

    If you don't want to install the templates, you can look at the individual files. Once you run the vsi file from the archive, on the first screen look for a blue "View files in Windows Explorer" link. This will let you see and modify the individual files.

  • User profile image
    Coulis

    Sorry for my English, but the link ...

    "https://channel9.msdn.com/Photos/ZippedFiles/269023_FriendlyErrors.zip"

    is bad.

    Please, give me the good link

    Think

  • User profile image
    Clint
  • User profile image
    Mark Nongkhlaw

    URL : http://www.codeproject.com/KB/aspnet/%20/ErrorHandlingASPNET.aspx

    Note the %20 I deliberately inserted in the URL. I got :

    Server Error in '/' Application.

    The resource cannot be found.

    Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

    Requested URL: /KB/aspnet/ /ErrorHandlingASPNET.aspx

    Question : How do I handle such types of errors to display me a friendlier page?

  • User profile image
    haris

    hi..

    i wanna ask something..

    what about if i only want to get the error message?

    regards,

    haris

  • User profile image
    Agustin

    Beautiful posting !

    There are issues that may arise, you may trap errors in requests other than pages.

    So, if your .NET engine is also handling images (such as the VS's Casini server does), you might be trapping requests even after the containing page was served.

    You should use a different pattern in that case, provided Server.Transfer won't work as expected.

    Hope this helps Smiley

    Drop me a line would you ? agustingarzon@yahoo.com

Add Your 2 Cents