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
I am not sure I understand your response.. How are you loading your controls and adding them to your controls collection?
That was the whole point of the bit added in the "Update" section.. You have the flexibility to use the SafeLoader wherever you please.
I am not sure why you feel you don't have access/control over the Html? The goal of the SafeLoader is that you dont care what the html is, you simply try and "output" the control (within the "bubble") and determine if it loads OK in its current state.
If it does (i.e. the html is returned) then you can do what you like with it, output the html, add the control to the controls collection, whatever!
If not, then again, you can do what you like, render an error message, throw a custom exception.. The choice is yours!
I hope this helps clarify things for you, if not, then please shout :)