Config类报错:
Error reading JObject from JsonReader. Current JsonReader item is not an object: Comment. Path '', line 1, position 28.
解决:
打开Json校验网:http://jsonlint.com/
把config.json内容全部粘过去,发现其头部 “/* 前后端通信相关的配置,注释只允许使用多行方式 */”这段注释导致了Json格式错误!赶紧删除,错误消失!
2. 文件结构:
3. ueditor.config.js:
配置为:serverUrl: URL + "controller.ashx"
4.config.json:
配置为: "imageUrlPrefix": "/scripts/ueditor/", /* 图片访问路径前缀 */
5.各种强大,各种华丽!
6. 后台取ueditor的值:
遇到:从客户端中检测到有潜在危险的 Request.Form 值 :
百度了一下,无非就是在web.config加两个节: (1)<pages validateRequest="false" controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"></pages>
(2)<httpRuntime requestValidationMode="2.0" maxRequestLength="102400 " />
OK,再测,依然是这个错误。
OK,我再给我的Action加上一个属性“[ValidateInput(false)]”,错误消失!
// ue.setContent('<p>德国战车7:1乱伦巴西!</p>');
//UE.getEditor('editor').execCommand('insertHtml', '<p>德国战车威力无比,希特勒笑了!</p>');
@Html.Raw(Model.Remark)
</script>, 搞定!真是奇怪!