PDA

View Full Version : [CLOSED] How to prevent poping the error window



wangyi
Sep 12, 2013, 8:25 AM
When requesting overtime or other errors , the website would pop a error window, including status code and status text, as follows.

6887


How to prevent poping this window?
I have logged the error, I did not need the error window.

Daniil
Sep 12, 2013, 12:42 PM
Hi @wangyi,

Please return false from a ResourceManager's AjaxRequestException listener to prevent a failure window from appearing.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">
protected void ThrowException(object sender, DirectEventArgs e)
{
throw new Exception();
}
</script>

<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server">
<Listeners>
<AjaxRequestException Handler="return false;" />
</Listeners>
</ext:ResourceManager>

<ext:Button runat="server" Text="Throw Exception" OnDirectClick="ThrowException" />
</form>
</body>
</html>