Sys.Net.WebServiceFailedException: The server method '' failed with

  • Thread starter Thread starter eusebiu
  • Start date Start date
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....
 
In VS TS 2008 this exception isn't raised.... only in VS 2008
Professional
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top