Catching unhandled exceptions in ASP.NET UserControls

前端 未结 7 1978
猫巷女王i
猫巷女王i 2021-01-06 00:58

I\'m dynamically loading user controls adding them to the Controls collection of the web form.

I\'d like to hide user controls if they cause a unhandled exception wh

7条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-06 01:45

    How about adding a new sub-class of UserControl that error-handles its render and load methods (so that they hide as you wish) and then inheriting from that for your user controls?

提交回复
热议问题