title: Substitute User Controls on Failure
body: <p>Recently, I had a user control I was developing throw an exception.  I know what caused the exception, but this issue got me thinking.  If I have a user control throw an exception for whatever reason and I wish to replace that usercontrol with something else (e.g. an error saying, "Sorry, this part of the page broke.") and perhaps log the error, what would be a good way to do it that could be done independently of what the user control is or does (i.e. I'm not saying what the user control does/is, because I want an answer where that is irrelevant).</p>
  
  <p>Code sample:</p>
  
  <pre><code>&lt;asp:TableRow VerticalAlign="Top" HorizontalAlign="Left"&gt;
      &lt;asp:TableCell&gt;
          &lt;UR:MyUserControl ID="MyUserControl3" runat="server" FormatString="&lt;%$ AppSettings:RVUC %&gt;"
              ConnectionString="&lt;%$ ConnectionStrings:WPDBC %&gt;" Title="CO" /&gt;
      &lt;/asp:TableCell&gt;
      &lt;asp:TableCell&gt;
          &lt;UR:MyUserControl ID="MyUserControl4" runat="server" FormatString="&lt;%$ AppSettings:RVUA %&gt;"
              ConnectionString="&lt;%$ ConnectionStrings:WPDBA %&gt;" Title="IEAO" /&gt;
      &lt;/asp:TableCell&gt;
  &lt;/asp:TableRow&gt;
  </code></pre>