C# 从webmethod Asp.Net返回大字符串时加载时间过长
我在Asp.Net中有一个WebMethod,一切看起来都很好。突然,我不得不更改一些参数,查询带来了太多的数据,我检查了字符串C# 从webmethod Asp.Net返回大字符串时加载时间过长,c#,asp.net,webmethod,load-time,C#,Asp.net,Webmethod,Load Time,我在Asp.Net中有一个WebMethod,一切看起来都很好。突然,我不得不更改一些参数,查询带来了太多的数据,我检查了字符串count=82452 问题是显示数据花费的时间太长。我基本上把所有数据放在一个div中,它显示了清单 或者可能字符串被破坏了或者其他什么东西,它不会进入成功函数吗?但我再次认为,不管它是什么,至少应该进入成功函数 以下是WebMethode: [System.Web.Services.WebMethod] public static string getResults
count=82452
问题是显示数据花费的时间太长。我基本上把所有数据放在一个div中,它显示了清单
或者可能字符串被破坏了或者其他什么东西,它不会进入成功函数吗?但我再次认为,不管它是什么,至少应该进入成功函数
以下是WebMethode:
[System.Web.Services.WebMethod]
public static string getResults(string post)
{
string newHtml = string.Empty;
for (int i = 0; i < 10; i++)
{
newHtml += Somefunction();
}
return newHtml;
}
有什么建议吗?看起来这个问题与这个问题有关:
应用相同的答案是有效的。您需要显示生成issue@Sayse. 请参阅更新问题。。
PageMethods.getResults(pageUrl, results_Text);
function results_Text(result, userContext, methodName) {
alert("adadasD");
document.getElementById("mainResults").innerHTML += result;
}