Hello...
Let's say we have a time consuming function, aaa inside a aspx page.
[WebMethod]
public static string aaa(int i)
{
Thread.Sleep(10 00);
return i.ToString();
}
Inside the aspx file:
<div>
<asp:ScriptMana ger ID="ScriptManag er1" runat="server"
EnablePageMetho ds="true">
</asp:ScriptManag er>
<span id="displayspan "></span>
<br />
<input type="button" value="click me" onclick="Stress ()"/>
<script language="javas cript" type="text/javascript">
function Stress()
{
for(var i = 0 ; i < 100 ; i++)
{
PageMethods.aaa (i, function(res, ctrl){
document.getEle mentById('displ ayspan').innerH TML
+=res.toString( ) + ' ';
});
}
}
</script>
</div>
The problem is that when I click on the button, I get an error:
"Sys.Net.WebSer viceFailedExcep tion: 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(10 00);
return i.ToString();
}
Inside the aspx file:
<div>
<asp:ScriptMana ger ID="ScriptManag er1" runat="server"
EnablePageMetho ds="true">
</asp:ScriptManag er>
<span id="displayspan "></span>
<br />
<input type="button" value="click me" onclick="Stress ()"/>
<script language="javas cript" type="text/javascript">
function Stress()
{
for(var i = 0 ; i < 100 ; i++)
{
PageMethods.aaa (i, function(res, ctrl){
document.getEle mentById('displ ayspan').innerH TML
+=res.toString( ) + ' ';
});
}
}
</script>
</div>
The problem is that when I click on the button, I get an error:
"Sys.Net.WebSer viceFailedExcep tion: 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....
Comment