Avoid try/catch hell in my Telerik controls
I posted for some help over here: Avoiding try/catch hell in my web pages
I have added an 'override OnError' in a common base class from all my pages, and can confirm that it works properly by putting a breakpoint within the function. However, I still get an exception propagating to the client, no matter what I do. Here is my issue: 1) I have a Telerik Grid control that is updated based on the value of a ComboBox. If an exception occurs and I catch it in a try/catch block then everything is fine. 2) If I get an exception when the ComboBox is changed but there is NO use of a try/catch block, then the error is caught in OnError. Howev开发者_如何转开发er, now I get a PageRequestManagerServerErrorException error just popping up in the client Ajax response (Javacript).
Any help?
There could be many reasons why it's happening. For one, it could be something with client-side rendering that's causing it, or it could be an AJAX request from an update panel or the RadAjaxPanel... one way to possibly tell is to tap into the Sys.WebForms.PageRequestManager's endRequest event, which is discussed briefly here: http://encosia.com/2007/07/18/how-to-improve-aspnet-ajax-error-handling/
So the error is possibly not happening around that area of code that has the try/catch block, but could be caused from something internal in the Telerik processes...
Could you share any code/markup?
Thanks.
精彩评论