This is a migrated thread and some comments may be shown as answers.

Maximum length exceeded

0 Answers 82 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Luan
Top achievements
Rank 1
Luan asked on 16 Sep 2008, 04:11 AM

Just a quick note to let everyone know of a possible problem when using a web service to populate the tree-view.

We had the case where we were trying to populate one level of the tree view (from a web service), and we recieved the error message "Maximum length exceeded" from Internet Explorer - no code source or break-point was able to catch where it happened.  Turns out it is just a common problem with web services - they return the data as XML, and if it is larger than the default limit, then this error is returned.

The solution is to extend the maxJsonLength, by adding the following section to your web.config file, at the configuration level, after the system.web node.  (This is assuming you already have the jsonSerialization section in the configSections part of the web.config file)

<

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

Hope this helps someone else who has the same issue.

No answers yet. Maybe you can help?

Tags
TreeView
Asked by
Luan
Top achievements
Rank 1
Share this question
or