Hi,
As per title, I would like to override the error message "transaction abort" when there is a DirectMethods timeout with a customized message. Please advice if this is possible and how to do it?
Thanks and regards.
Printable View
Hi,
As per title, I would like to override the error message "transaction abort" when there is a DirectMethods timeout with a customized message. Please advice if this is possible and how to do it?
Thanks and regards.
Hi,
Please look at the example.
Example
Code:<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
[DirectMethod]
public void AbortTransaction()
{
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Ext.Net Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server">
<Listeners>
<AjaxRequestException Handler=" if (response.isAbort && !o.directMethodFailure) {
alert('Aborted (I am defined globally)');
}" />
</Listeners>
</ext:ResourceManager>
<ext:Button runat="server" Text="Global message">
<Listeners>
<Click Handler="Ext.net.DirectMethods.AbortTransaction({
timeout : 10,
showFailureWarning : false
});" />
</Listeners>
</ext:Button>
<ext:Button runat="server" Text="Custom 'aborted' message">
<Listeners>
<Click Handler="Ext.net.DirectMethods.AbortTransaction({
timeout : 10,
showFailureWarning : false,
failure : function (result, response, control, eventType, action, extraParams, o) {
if (response.isAbort) {
alert('Aborted (I am defined for a specified DirectMethod)');
}
}
});" />
</Listeners>
</ext:Button>
</form>
</body>
</html>
Hi Daniil,
Thanks. How about if the DirectMethod has a passed parameter? [i.e. AbortTransaction(int value1, string value2) ]
No problem, a config should be at the end of all parameters.
Hi Daniil,
Sorry but can you give an example on how to construct the javascript if the DirectMethod is like below?
Code:<script runat="server">
[DirectMethod]
public void AbortTransaction(int width, int height)
{
}
</script>
Example
See also:Code:Ext.net.DirectMethods.AbortTransaction(width, height, {
timeout : 10,
showFailureWarning : false
});
https://examples1.ext.net/#/Events/D...hods/Overview/
Hi Daniil,
As always, appreciate your help.
Thanks and regards.