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.
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");}
Hi Viktor Snezhko,
I got error "'Infragistics.WebUI.Shared.CallBackManager' does not contain a definition for 'AddErrorHandler'". What should I do?
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.