ASP.NET UserControl OnError

Posted by michl86 on Stack Overflow See other posts from Stack Overflow or by michl86
Published on 2010-06-07T15:58:26Z Indexed on 2010/06/09 3:52 UTC
Read the original article Hit count: 660

UserControls in ASP.NET (4.0) inherit from System.Web.UI.UserControl. VisualStudio intellisense suggest OnError as valid override of TemplateControl. At runtime .NET ignores this error handling. Only the OnError at Page-Level gets invoked. Did i miss anything or is there a design issue?

public partial class Sample : System.Web.UI.UserControl
{
    protected override void OnError(EventArgs e)
    {
        // Never reach ;o)
        base.OnError(e);
    }
}

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about exception-handling