简体   繁体   English

jQuery ajax form.serialize()在服务器和本地IIS上不起作用

[英]jquery ajax form.serialize() not working on Server and on local IIS

I have below code in Partial View ,Jquery and Controller . 我在Partial View,Jquery和Controller中有以下代码。

I have used $("form").serialize(); 我用过$(“ form”)。serialize(); method and trying to Post Data to Controller in which I am 方法并尝试将数据发布到我所在的控制器

catching it in Model . 在Model中捕获它。

Code is working fine on Local when I run it with VS2010 but Code is not working on Server for 当我与VS2010一起运行时,代码在Local上运行正常,但在Server for

around 100 Records when I am trying to send it to Controller Screen gets hang on for more than 30 当我尝试将其发送到控制器屏幕时,大约有100条记录被挂起了30多个

min.Also not getting any error on server. 最低,在服务器上也没有任何错误。

Can anyone let me know more about it. 谁能让我知道更多。

1] Jquery Code 1] jQuery代码

     $('#btnSave').click(function () {
    $("#dvAjax1").css('display', 'block');
    var assignCalculationsData = $("form").serialize();
    $.ajax(
    { type: "POST",
        url: "SaveAssignedCalculations/Pricing",
        data: assignCalculationsData,
        success: function (data) {
            data = $.trim(data);
            if (data != "") {
                var $response = $(data);
                var hdValue = $response.find('#hdSaveStatus').val();

                if (hdValue == "2") {//enter mandatory
                    jAlert('Please enter mandatory data.');
                }
                else if (hdValue == "1") {

                    $("#dvBody").html("");
                    $("#dvBody").html(data);

                    jAlert('Calculations Saved Successfully');
                }
                else {//No Data ('0')
                    jAlert('Please enter mandatory data.');
                }
            }
            else {
                jAlert('Please assign calculation(s) before saving.');
            }
            $("#dvAjax1").css('display', 'none');
          }
       });
      });
      })

2] Controller Code 2]控制器代码

          public PartialViewResult SaveAssignedCalculations(List<AssignCalculationsDataModel> lstAssignCalculationsSourceDataModel, string fundType, string accountCode, string shareClassID)
           {
             //Some code
           }

Thanks in Advance. 提前致谢。

Thanks, Vaibhav 谢谢,Vaibhav

Try to set timeout property and see if the server takes more time to process the request. 尝试设置timeout属性,并查看服务器是否花费更多时间来处理请求。

$.ajax({
    url: "SaveAssignedCalculations/Pricing",
    type: "POST",        
    timeout: 10000,
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在MVC中使用JQuery ajax form.serialize()发送HttpPostedFileBase字段 - Sending HttpPostedFileBase field using JQuery ajax form.serialize() in MVC form.serialize不适用于字符串列表 - form.serialize not working for a list of strings Form.serialize()似乎返回null - Form.serialize() seems to return null DirectorySearcher 在本地工作但不在 IIS 服务器中工作 - DirectorySearcher working in Local but not working in IIS server 如何序列化表单字段并将其发送到服务器,jquery? - How to serialize the form fields and send it to server, jquery? WCF服务在本地而非服务器IIS上运行以实现功能 - WCF service working on local not server IIS for functions css在服务器iis 7上运行不正常,就像本地一样 - css not working well in server iis 7 like on local Multiview 在 IIS 服务器中不起作用,但在我的本地服务器(XAMPP)中运行良好 - Multiview is not working in IIS server, but working well in my local server (XAMPP) Ajax自动完成CSS在iis和服务器上工作正常,但在本地计算机上工作不正常 - Ajax Auto complete Css works fine in iis and the server but not in local machine kendo grid update \\ insert在IIS服务器上不起作用,但在本地服务器上起作用 - kendo grid update\insert not working on IIS server but it is working on Local
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM