c# - Limits to setting HTML via JavaScript and Page Methods? -
i have asp.net , c# page uses client-side page methods like:
<!-- language: lang-js --> function showdetails(layername, transdate) { pagemethods.gettransactiondetails(transdate, function (result) { $(layername).html(result); });
generally speaking, code works fine , pulls list of transactions (formatted in html) , displays accordingly.
however, code not display on days when there's lot of data. data sets may 30 rows , displays fine. when have 120 rows, not display @ all.
so i'm guessing i'm hitting sort of limit html display. there limits associated of code above using? thoughts on why wouldn't display @ all?
it seems hitting maximum length of json strings accepted internal json serializer (the javascriptserializer class). default value 4 mb (2097152 characters). reference: http://msdn.microsoft.com/en-us/library/system.web.script.serialization.javascriptserializer.maxjsonlength(v=vs.110).aspx
you may override in web.config
, set higher value:
<system.web.extensions> <scripting> <webservices> <jsonserialization maxjsonlength="5242880" /> <!-- 10 mb approx --> </webservices> </scripting> </system.web.extensions>
footnote: returning such huge chunk of data client may not idea.
Comments
Post a Comment