Completed
Last Updated: 08 Jun 2023 14:16 by ADMIN
Release R2 2023 SP1
Hudson
Created on: 05 Jun 2023 18:36
Category: MultiSelect
Type: Bug Report
0
RadMultiSelect with huge dataset errors out during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.

I am getting the following error when using RadMultiSelect with over 13000 records:

Error InnerException Message: Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.
 Error InnerException StackTrace:    at System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, StringBuilder output, SerializationFormat serializationFormat)
   at Telerik.Web.UI.AdvancedJavaScriptSerializer.Serialize(Object obj)
   at Telerik.Web.UI.RadMultiSelect.DescribeItems(IScriptDescriptor descriptor)
   at Telerik.Web.UI.RadMultiSelect.DescribeComponent(IScriptDescriptor descriptor)
   at Telerik.Web.UI.ScriptRegistrar.GetScriptDescriptors(Control control)
   at Telerik.Web.UI.RadDataBoundControl.GetScriptDescriptors()
   at System.Web.UI.ScriptControlManager.RegisterScriptDescriptors(IScriptControl scriptControl)
   at Telerik.Web.UI.RadDataBoundControl.RegisterScriptDescriptors()
   at Telerik.Web.UI.RadDataBoundControl.Render(HtmlTextWriter writer)
   at Telerik.Web.UI.RadMultiSelect.Render(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)

I already have <jsonSerialization maxJsonLength="2147483647"> in my web.config but still errors out.

Telerik.Web.UI Version: 2022.2.622.45

Seems similar to this issue: https://www.telerik.com/forums/maxjsonlength-exceeded-in-radmap

But updating to higher version than 2020 didn't seem to solve it. Was the fix only for RadMap?

As it was for other

2 comments
ADMIN
Rumen
Posted on: 08 Jun 2023 14:16

Hi Hudson,

I am following up that the problem is fixed and will not exist in the next official release R2 2023 SP1 in July.

Have a successful day.

Regards,
Rumen
Progress Telerik

Heads up! Telerik UI for ASP.NET AJAX versions for .NET 3.5 and 4.0 are retired. Progress will continue shipping assemblies compatible with .NET 4.5 and later. See whether this affects your apps in this article.
ADMIN
Rumen
Posted on: 06 Jun 2023 13:52

Hi Hudson,

Thank you for reporting this problem! I converted your ticket to a public bug report to share you with your fellow developers.

I managed to reproduce the problem with the following configuration:

 

ASPX

        <telerik:RadMultiSelect ID="RadMultiSelect1" runat="server" DataTextField="text" DataValueField="value" Filter="Contains" Width="400px"
            Placeholder="Select attendees...">
        </telerik:RadMultiSelect>

 

ASPX.CS

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            for (int i = 0; i < 130005; i++)
            {
                MultiSelectItem newItem = new MultiSelectItem() { Text = "Item " + i, Value = i.ToString() };

                RadMultiSelect1.Items.Add(newItem);
            }
        }
    }

 

web.config

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

 

I logged it for fixing and we will do our best to resolve it in the upcoming R2 2023 SP1 release, due in mid-July. Your Telerik points are also updated.

You can also try the provided Virtualization functionality, but it is important to note that it is supported only with WebService binding.
When Virtualization is enabled, a very small portion of the data should be sent to the client-side. You can find more information in the Virtualization article.

Best Regards,
Rumen
Progress Telerik

Heads up! Telerik UI for ASP.NET AJAX versions for .NET 3.5 and 4.0 are retired. Progress will continue shipping assemblies compatible with .NET 4.5 and later. See whether this affects your apps in this article.