Wednesday, June 11, 2008

Method Error 500

I've been assigned a bug concerning an AJAX cascading drop down combo box. When the Ajax cascading drop down combo box's value is changed by the user, a secondary combo box has its values reloaded. This is done by calling a web service. The bug is that "Method Error 500" is displayed as the only item on occasion.

After some rooting around, it turns out that this is caused by too much data being returned in the SQL query behind the web service call, so the web service returns an error. A simple change to the web.config file can increase the size limit of data returned:

<system.web.extensions>
<scripting>
<webservices>
<jsonserialization maxjsonlength="5000000">
</jsonserialization>
</webservices>
</scripting>
<system.web.extensions>
<scripting>
<webservices>
<jsonserialization maxjsonlength="5000000">
</jsonserialization>
</webservices>
</scripting>
</system.web.extensions></system.web.extensions>

No comments:

Post a Comment