Study/Bookmark2011. 7. 8. 09:41
 

Server Error in ‘/’ Application.

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

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidOperationException: Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.

Source Error: 


처음 이 에러를 만났을 때... 아.. 큰일이다 싶었는데, 해결 하고 나니 후련하다. ㅎㅎ

일반적인 상황에선 데이터 초과할 일이 없겠으나, 한 페이지에 대량의 데이터를 불러오는 경우

웹 사이트의 web.config 를 뒤져서 직접 수정 해도 되겠으나

프로젝트 내에 구현 하는 것이 여러모로 정신 건강에 도움이 됨.. ^^

출처 : http://brianreiter.org/2011/01/03/custom-jsonresult-class-for-asp-net-mvc-to-avoid-maxjsonlength-exceeded-exception/
Posted by 굥쓰