E
eusebiu
Hello...
Let's say we have a time consuming function, aaa inside a aspx page.
[WebMethod]
public static string aaa(int i)
{
Thread.Sleep(1000);
return i.ToString();
}
Inside the aspx file:
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server"
EnablePageMethods="true">
</asp:ScriptManager>
<span id="displayspan"></span>
<br />
<input type="button" value="click me" onclick="Stress()"/>
<script language="javascript" type="text/javascript">
function Stress()
{
for(var i = 0 ; i < 100 ; i++)
{
PageMethods.aaa(i, function(res, ctrl){
document.getElementById('displayspan').innerHTML
+=res.toString() + ' ';
});
}
}
</script>
</div>
The problem is that when I click on the button, I get an error:
"Sys.Net.WebServiceFailedException: The server method '' failed with
the following error:" .... and no error description
Can someone tell me how to workaround this issue?
Thanks
P.S. In Firefox 2.0.0.16, Opera and Safari(Windows version) this code
works....
Let's say we have a time consuming function, aaa inside a aspx page.
[WebMethod]
public static string aaa(int i)
{
Thread.Sleep(1000);
return i.ToString();
}
Inside the aspx file:
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server"
EnablePageMethods="true">
</asp:ScriptManager>
<span id="displayspan"></span>
<br />
<input type="button" value="click me" onclick="Stress()"/>
<script language="javascript" type="text/javascript">
function Stress()
{
for(var i = 0 ; i < 100 ; i++)
{
PageMethods.aaa(i, function(res, ctrl){
document.getElementById('displayspan').innerHTML
+=res.toString() + ' ';
});
}
}
</script>
</div>
The problem is that when I click on the button, I get an error:
"Sys.Net.WebServiceFailedException: The server method '' failed with
the following error:" .... and no error description
Can someone tell me how to workaround this issue?
Thanks
P.S. In Firefox 2.0.0.16, Opera and Safari(Windows version) this code
works....