0

I am receiving this error and I know what the reason is. I found multiple discussions of this problem: here, here, and here for example

They would work for me but my action retruns a partial view instead of Json result:

public ActionResult GetData(string key)
{
 var model = dB.GetSata(key);
 return PartialView("~/Areas/Admin/Views/InfoPartial.cshtml",model);
}

@model MyWeb.Models.InfoModel

@if (Model != null)
{
    @(Html.Kendo().Grid<MyWeb.Models.InfoModel>().Name("Info").BindTo(Model))
    //... more code here
}

How do I incorporate my custom js serializer with extended length:

                var serializer = new JavaScriptSerializer();

                serializer.MaxJsonLength = Int32.MaxValue;

                var result = new ContentResult
                {
                    Content = serializer.Serialize(sites),
                    ContentType = "application/json",
                };

into my Action code when I need to return a PartialView ?

PS: this does not work

<jsonSerialization maxJsonLength = "2147483647"></jsonSerialization>
Community
  • 1
  • 1
AstroSharp
  • 1,872
  • 2
  • 22
  • 31

1 Answers1

0

Had the exact same problem using Kendo UI Grid and ended up replacing the default JsonValueProviderFactory as mentioned in this post

JsonValueProviderFactory throws "request too large"

Community
  • 1
  • 1
  • 1
    While this might be a valid answer, you will want to provide the relevant code and an explanation of what makes this answer correct. – rfornal Feb 14 '15 at 14:36