【问题标题】:Too much load time when returning large string from webmethod Asp.Net从 webmethod Asp.Net 返回大字符串时加载时间过长
【发布时间】:2014-08-27 07:00:31
【问题描述】:

我在 Asp.Net 中有一个 WebMethod,一切看起来都运行良好。突然我不得不更改一些参数并且查询带来了太多数据我检查了字符串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;
}

这里是JS代码:

PageMethods.getResults(pageUrl, results_Text);
function results_Text(result, userContext, methodName) {
        alert("adadasD");
        document.getElementById("mainResults").innerHTML += result;
}

有什么建议吗?

【问题讨论】:

  • 您需要显示产生问题的代码
  • @Sayse。请参阅更新问题..

标签: c# asp.net webmethod load-time


【解决方案1】:

看起来这个问题与这个问题有关: Return large string from ajax call using Jquery to Web Method of ASP.NET

并且应用相同的答案有效。

【讨论】:

    猜你喜欢
    • 2012-01-17
    • 2011-11-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多