Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 937379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:28:08+00:00 2026-05-15T21:28:08+00:00

Link in this URL.. Please first two steps can anybody explain me? The System.Web.Mvc.dll

  • 0

Link

in this URL..

Please first two steps can anybody explain me?

The System.Web.Mvc.dll comes with the HandleErrorAttribute class, which contains..wait for it…the HandleError attribute. This information won’t be important until later in this series, but the HandleErrorAttribute class inherits from the FilterAttribute class, and implements the IExceptionFilter interface – the interface requires a method with the following signature.

public virtual void OnException(ExceptionContext filterContext);

Do i need to create Interface?

where Do I need to write OnExceptoin?

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T21:28:09+00:00Added an answer on May 15, 2026 at 9:28 pm

    You don’t need to create any interface, nor worry about the OnException method or its implementation. All you need to do is decorate your controller with the [HandleError] attribute, like so:

    [HandleError]
    public class HomeController : Controller {}
    

    Then go ahead and write some actions inside this controller that might throw an exception and instead of the YSOD (Yellow Screen of Death) you will see a custom error page that you’ve configured. You also need to activate custom errors in your web.config:

    <system.web>
        <customErrors mode="On" />
    </system.web>
    

    By default the ~/Views/Shared/Error.aspx view will be rendered in case of exception. You could define specific error views based on the exception being thrown:

    [HandleError(ExceptionType = typeof(ApplicationException), View = "AppErrorPage")]
    

    means that if an ApplicationException is thrown, the ~/Views/Shared/AppErrorPage.aspx view will get rendered.

    That’s what the framework provides you out-of-the-box. If this is not enough for your needs and doesn’t work in your specific scenario you might start worrying about implementing a custom IExceptionFilter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

can I check if a file exists at a URL? This link is very
When a button/link is clicked, I want this URL to be called followed by
I got this code in order to build an url for the link using
First question on SOF, please be gentle if this may be a stupid question.
I am doing this: $.ajax({ type: 'GET', url: this.href, async: true, data: $('form').first().serialize(), beforeSend:
I am following this tutorial to create the first mvc application ( Create a
I am having a Html hyperlink. I need to link this hyperlink to another
This link describes an exploit into my app using fckEditor: http://knitinr.blogspot.com/2008/07/script-exploit-via-fckeditor.html How do I
following this link i was able to load and read pixels from a .gif.
This link http://ajaxcontroltoolkit.codeplex.com/releases/view/11121#DownloadId=28808 shows a popup on which one has to agree before being

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.