5 Mart 2013 Salı

Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property. Hatası

"Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property." Hatasının çözümü:

Genelde Json'dan dönen değerin limiti ile ilgili bir hatadır.Default Değeri 4 MB olduğu için yukarıdaki hatayı verecektir,bu hatanın çözümü için web.config dosyamıza aşağıdaki kodu yazalım.

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

Burada json'den dönen değerin uzunluğunu arttırmış olduk.

Hiç yorum yok:

Yorum Gönder