PDA

View Full Version : [CLOSED] always show "request failure" message box



hdsoso
Jul 03, 2014, 4:27 PM
when open the url "http://info.hdsoso.com/fenlei_city.aspx?prov=5&city=103" , then quickly click one of cate,such as "家政", then show the error below
http://forums.ext.net/attachment.php?attachmentid=13291&stc=1

the same error show when i open a url such as "http://info.hdsoso.com/fenlei_city.aspx?prov=5&city=103", then quickly click the home page , then ,show the same error.

hdsoso
Jul 03, 2014, 4:32 PM
13311
error show when quickly click the page . if click slowly , no error.

geoffrey.mcgill
Jul 03, 2014, 5:01 PM
The DirectMethod or DirectEvent Request you are making is failing somehow.

hdsoso
Jul 04, 2014, 1:13 AM
it is because the page does not finish the requests before an user clicks a link on the page?

geoffrey.mcgill
Jul 04, 2014, 3:23 AM
Yes, that might be related.

hdsoso
Jul 04, 2014, 4:33 AM
how to do ?

geoffrey.mcgill
Jul 04, 2014, 5:27 AM
how to do ?

How to do what? I do not understand what you are requesting.

hdsoso
Jul 04, 2014, 8:18 AM
how to remove the "request failure" messeagebox

Daniil
Jul 04, 2014, 8:39 AM
Hi @hdsoso,

You could try to handle

<ext:ResourceManager runat="server" ShowWarningOnAjaxFailure="false" />
or/and handle a ResourceManager's AjaxRequestException event.

If you use a Loader, then its

<Loader ShowWarningOnFailure="false">
setting and the Exception event might be helpful as well.

RCN
Jul 07, 2014, 3:24 PM
Let me know whether the following example helps you



<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
<script language="javascript">

var ajaxRequestException = function (response, result, el, eventType, action, extraParams, o) {

Ext.Msg.alert("Error", result.errorMessage);
}

var btnClick = function () {

Ext.net.DirectMethod.request({
url: Ext.net.ResourceMgr.resolveUrl("~/Example/PerformAction"),
cleanRequest: true,
success: function (result) {
alert("Success");
},
failure: function (resposta) {
alert("Failure");
}
});
}
</script>
</head>
<body>
<ext:ResourceManager ScriptMode="Development" runat="server">
<Listeners>
<AjaxRequestException Fn="ajaxRequestException" />
</Listeners>
</ext:ResourceManager>
<ext:Button Text="Click Me !!!" runat="server">
<Listeners>
<Click Handler="btnClick();" />
</Listeners>
</ext:Button>
</body>
</html>




namespace RCNBS.Visions.SandBox.Controllers
{
public class ExampleController : System.Web.Mvc.Controller
{
public ActionResult Index()
{
return View();
}

public AjaxResult PerformAction()
{
return new AjaxResult
{
ErrorMessage = "Error"
};
}
}
}