AJAX update panel swallows exceptions and strange behavior

I just caught the strange behavior of the AJAX update panel. The first opinion confused me in that I noticed that when I throw an exception during an asynchronous postback, it is absorbed by the environment.

Since the first time I encountered such a problem, I started experimenting, trying to either throw different types of exceptions, or throw the same exceptions outside of the updatePanel (for example, in the Page_Init event). The conclusion is that when an exception is thrown in an async callback, the environment swallows it and the page displays as if nothing had happened (this is an unacceptable point). But when I throw an exception in the normal life cycle of the page, the exception is thrown in the usual way and the page fails, as expected (I hope that I will be right with my conclusions)

The question is what should I do to enable exception throwing

(By the way, when I wrote this message, I noticed that due to changes in business logic, I no longer need to throw the above exception, but I still wonder why this happens)

The second problem with updatePanel is that when I set it {up.Visible = false;} to Page_Load, then with some method we set it {up.Visible = true; up.Update ()} - it is still not passed. I set breakpoints in both places; .visible is set to true when the page is displayed, but in any case it still remains invisible. I see no obvious reason.

Thanks.

+3
source share
1 answer

asp.net , ScriptManager:

EnablePartialRendering="false"
+2

Source: https://habr.com/ru/post/1703578/


All Articles