为什么我收到此错误?我有和html从web方法返回,当html内容的内容长度超过我得到此错误时:
"消息":"超出最大长度。"," StackTrace":"在 System.Web.Script.Serialization.JavaScriptSerializer.Serialize(对象 obj,StringBuilder输出)\ r \ n at System.Web.Script.Serialization.JavaScriptSerializer.Serialize(对象 obj)\ r \ n at System.Web.Script.Services.RestHandler.InvokeMethod(HttpContext的 context,WebServiceMethodData methodData,IDictionary`2 rawParams)\ r \ n 在 System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext的 context,WebServiceMethodData methodData)"" ExceptionType":" System.InvalidOperationException"
答案 0 :(得分:0)
内容有多大?
您可以尝试增加JSONN序列化限制:
<system.web.extensions>
<scripting>
<webServices>
<jsonSerialization maxJsonLength="2147483647">
</jsonSerialization>
</webServices>
</scripting>
</system.web.extensions>