Has anyone at Infragistics considered improving the mechanism through which the WARP Panel handles errors? I had an issue with two controls having the same ID after Page_Init in a WARP Panel; the panel would encounter an exception and the entire page would refresh without providing any clues about the nature or cause of the exception. If it's not possible to improve the exception handler on the Panel, perhaps some developer guidelines or recommendations for identifying errors would be helpful.
This is helpful, but there are still circumstances when an error can occur and no information is presented about the nature or source of the error. Is there not a "debug mode" that causes the webpage to halt or bubble errors through the Call Stack? I spent most of yesterday and today looking for an error that I have not yet found; all I know is that clicking on a particular ImageButton button causes an Async Postback; Page_Init runs, Page_Load runs, the server-side handler runs, and then the Page completely reloads. I think the error is related to duplicate controls on the page having the same ID or a null reference. It would be very helpful to at least know what line causes the error. The way that the Panel handles the error, I can only guess and try to step through the code.
Oh, thanks.
Hi Tina,
I looked at history of CallBackManager. That method was added in January of 2007. That means that your version of NetAdvantage was built before that date, so you need to upgrade to more recent one.
Hi Viktor Snezhko,
I got error "'Infragistics.WebUI.Shared.CallBackManager' does not contain a definition for 'AddErrorHandler'". What should I do?
Hi,
To process error on client you may use ClientSideEvents.Error. Below is example:
<script type="text/javascript">function WebAsyncRefreshPanel1_Error(oPanel,oEvent,flags){ var serverError = ig_shared.getCBManager().serverError; alert('flag:' + flags + '\nserverError:' + serverError);}</script>
<igmisc:WebAsyncRefreshPanel ID="WebAsyncRefreshPanel1" runat="server" ClientError="WebAsyncRefreshPanel1_Error"> <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" /></igmisc:WebAsyncRefreshPanel>
To process error on server (global error) you may use AddErrorHandler. Below is example:
void OnWarpError(object sender, UnhandledExceptionEventArgs e){ object ex = e.ExceptionObject; if(e.IsTerminating) ex = "Error will trigger full post back on client.";}
protected void Button1_Click(object sender, EventArgs e){ //throw new Exception("Click exception");}