Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/30.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
获取的最大URL长度超过了c#MVC_C#_Asp.net_Asp.net Mvc - Fatal编程技术网

获取的最大URL长度超过了c#MVC

获取的最大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

通过使用上述代码,我试图保存用户的详细信息。但是当配置文件pic太长时,控制器方法将不调用,并显示内部服务器错误。

您好,请检查以下解决方案:

您需要在Web.Config文件中更改maxAllowedContentLength

在system.web中:


和系统中的.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);
        }
    })