【问题标题】:Issue with Kendo Grid Read action剑道网格读取操作的问题
【发布时间】:2015-05-12 14:04:58
【问题描述】:

我正在使用 Kendo Grid 加载数据。在这种特殊情况下,我必须将大量数据从 Kendo Grid 传递到 Controller。

我的剑道网格阅读动作是这样的:

.Read(read => read.Action("BindJESummary", "JEDataView", new
{
    FilterQueryId = @Model.FilterQueryId,
    KnowledgeAccounts = @Model.KnowledgeAccounts,
    GLAccounts = @Model.GLAccounts,
    jeFilterTestingModel = Json.Encode(@Model.JEFilterTestingModelData)
}).Type(HttpVerbs.Post))

这工作正常,但是当数据太大时,它就坏了。它没有击中控制器。当我们检查时,Kendo 正在 URL 中发送大量数据。

如何让 Kendo 在 Post 请求正文中发送数据?

或者,有没有更好的方法来从 Kendo Grid 发出帖子请求?

【问题讨论】:

  • 你的内容长度只有40,你怎么能说这是大数据,lol..问题是你使用的是Json.Encode,你试过删除它还是尝试另一个库来序列化?跨度>
  • 你的控制器动作是什么样的?
  • 答案在您自己的问题中。使用 POST。为什么要在 GET(即.Read())请求中将所有这些数据发送到控制器?
  • @DionDirza 当只有 40 与 url 一起使用时。我还没有尝试任何其他图书馆。我会试试的。
  • @Brett May,我只使用了 Post (Type(HttpVerbs.Post))。

标签: c# asp.net-mvc kendo-ui kendo-grid kendo-asp.net-mvc


【解决方案1】:

您可以通过编辑 Web.Config 来控制最大限制数据

<system.web.extensions>
<scripting>
    <webServices>
        <jsonSerialization maxJsonLength="1000000000" />
    </webServices>
</scripting>
</system.web.extensions>

如果这没有帮助,试试这个

<system.webServer>
    <security>
        <requestFiltering>
            <requestLimits maxAllowedContentLength="524288000"/>
        </requestFiltering>
    </security>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-03
    • 2018-09-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多