making UserControl catch all its exceptions

A

Ael

Is there any way to make a UserControl catch all its exceptions?
(I have a webiste built on one page with placeholders that load controls,
so even if one of the controls throws an exception I still would like to be
able to continue load other controls).
It can be done of the System.Web.UI.Page, however it does not work for
UserControl-s. Subscribing to the OnError event does not help.

Thank you!
 
R

ranganh

Hi,

What you can do is, you can make the control's visible property to false so
that it doesnt affect the other controls in the page.

In the Try.. Catch block, if an exception occurs, make the visible property
of the usercontrol to false.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top