【发布时间】:2017-02-16 02:54:20
【问题描述】:
您好,我正在开发 MVC4 应用程序。我正在将值保存到数据库。我遇到了错误。
The request filtering module is configured to deny a request where the query string is too long.
我正在进行 ajax 调用并将数据作为 Json 发送如下。
$.ajax({
type: "POST",
cache: false,
url: '/UploadDocument/SubmitDoc?JsonValue=' + JSON.stringify(SaveUpload) + '&gridData=' + strOrderArr,
contentType: "application/json; charset=utf-8",
dataType: "json",
headers: {
'VerificationToken': forgeryId
},
success: function (response) {}
});
Web.config
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="1073741824" />
</requestFiltering>
</security>
我可以知道在将大量数据发布到数据库时,我是否遵循了处理上述情况的好方法?提前致谢。
【问题讨论】:
-
嗨 Niranjan,构建您的 Web 服务以通过请求正文而不是 URL 接受数据
-
感谢您的留言。我可以知道什么样的网络服务?上述场景如何实现?可以给我一些网站的链接吗?
-
我已经放了 maxAllowedContentLength?这与 web.config 中的 maxQueryStringLength 有什么不同吗?
-
谢谢你,Div。我将浏览您提供的链接。
标签: c# jquery json asp.net-mvc-4 iis