获取的最大URL长度超过了c#MVC
通过使用上述代码,我试图保存用户的详细信息。但是当配置文件pic太长时,控制器方法将不调用,并显示内部服务器错误。您好,请检查以下解决方案: 您需要在Web.Config文件中更改maxAllowedContentLength: 在system.web中:获取的最大URL长度超过了c#MVC,c#,asp.net,asp.net-mvc,C#,Asp.net,Asp.net Mvc,通过使用上述代码,我试图保存用户的详细信息。但是当配置文件pic太长时,控制器方法将不调用,并显示内部服务器错误。您好,请检查以下解决方案: 您需要在Web.Config文件中更改maxAllowedContentLength: 在system.web中: 和系统中的.webServer 干杯调整maxAllowedContentLength以增加限制检查web.config并将requestLimits元素中的maxAllowedContentLength调整为更大的数字(最大值为42
和系统中的.webServer
干杯调整
maxAllowedContentLength
以增加限制检查web.config并将requestLimits
元素中的maxAllowedContentLength
调整为更大的数字(最大值为4294967295或大约4 GB)。该操作正常。谢谢
function GetUserEditProfileDetails() {
var res = {};
res.ID = parseInt($("#User_ID_EditProfile").val());
res.FirstName = $("#FirstName").val();
res.LastName = $("#LastName").val();
res.EmailId = $("#EmailId").val();
res.Mobile = $("#Mobile").val();
res.ProfilePic = $(".ProfilePic").attr("src");
return res;
}
$.ajax({
url: "Profile/UpdateUser",
async: false,
type: "POST",
data: GetUserEditProfileDetails(),
dataType: "json",
contentType: "application/json; charset=utf-8",
error: function (jqXHR, textStatus, errorThrown) {
alert(JSON.stringify(jqXHR) + "-" + textStatus + "-" + errorThrown);
}
})