简体   繁体   English

如何从控制器加载大型数据集到asp.net mvc中查看

[英]How to load large data set from controller to view in asp.net mvc

Is there any way to load more than 2 MB data(15000 records) using ajax in ASP.net MVC. 有没有办法在ASP.net MVC中使用ajax加载超过2 MB的数据(15000条记录)。 In ajax call if data is more than 2 MB ajax response is coming as null, if less than 2 MB it is coming perfectly. 在ajax调用中,如果数据超过2 MB,则ajax响应将为null,如果小于2 MB则完全正确。

I have added following in my web.config 我在web.config中添加了以下内容

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

 <security>
        <requestFiltering>
            <requestLimits maxAllowedContentLength="524288000" />
        </requestFiltering>
    </security>



<add key="aspnet:MaxJsonDeserializerMembers" value="150000" />

But nothing worked for me. 但没有什么对我有用。 Please help me. 请帮我。

Thanks in Advance, 提前致谢,

Anoop Xaviour. Anoop Xaviour。

With really large data sets it is worth considering server-side processing: http://datatables.net/release-datatables/examples/data_sources/server_side.html . 对于非常大的数据集,值得考虑服务器端处理: http//datatables.net/release-datatables/examples/data_sources/server_side.html With this method, since all the processing is done on the server by an SQL engine which is designed for exactly this sort of thing (unlike Javascript!) it is super fast and can cope with massive data sets (I've seen DataTables using 20 million+ records). 使用这种方法,由于所有的处理都是在SQL服务器上完成的,这个SQL引擎专门针对这类事情而设计(与Javascript不同!),它非常快,可以处理海量数据集(我已经看过使用20的DataTables)百万+记录)。 The tradeoff is that you need an XHR request for each table draw, which might or might not be acceptable given your setup. 权衡是您需要为每个表抽取提供XHR请求,根据您的设置,这可能会或可能不会被接受。

I'd also, personally, tend to avoid infinite scrolling - I don't like it as an interface paradigm for a table - personally I much prefer Scroller: http://datatables.net/extras/scroller/ . 我个人也倾向于避免无限滚动 - 我不喜欢它作为桌面的界面范例 - 我个人更喜欢Scroller: http//datatables.net/extras/scroller/ That can be used with large data sets with data being loaded by Ajax and deferred rendering enabled. 这可以与大型数据集一起使用,其中数据由Ajax加载并且启用延迟渲染。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM