mono下使用ajax控件报Details: Error parsing near错误

centOS-6.5 + mono-3.6+jexus-3.6.1

使用ajax控件时,在windows iis下没有问题,linux 下报如下错误

行: 16
错误: Sys.WebForms.PageRequestManagerParserErrorException:
The message received from the server could not be parsed.
Common causes for this error are when the response is modified by calls to Response.Write(),
response filters, HttpModules, or server trace is enabled.
Details: Error parsing near 'v>
                           
</div>|6'.

试着在page 上加  EnableEventValidation="false"  ValidateRequest="false" 不起作用,在web.config加  <httpRuntime requestValidationMode="2.0"/> <pages validateRequest="false" > 问题依旧

后来打开页面源文件发现有中文乱码,查看web.config <globalization/>字符配置 为gb2312

修改为utf-8 : <globalization requestEncoding="utf-8" responseEncoding="utf-8"  />

再次调试问题解决。不过又出现一个问题就是页面中文全是乱码。

在page页面添加  <meta charset="utf-8" /> 再次调试乱码消失

原文地址:https://www.cnblogs.com/qingwa008/p/3984400.html