0

我在随机时间遇到上述错误,但我无法找到解决方案。

       //MyPage.aspx
       //Reload Ajax function
       $.fn.dataTableExt.oApi.fnReloadAjax = function (oSettings, sNewSource, fnCallback) {
           if (typeof sNewSource != 'undefined') {
               oSettings.sAjaxSource = sNewSource;
           }
           this.oApi._fnProcessingDisplay(oSettings, true);
           var that = this;

           oSettings.fnServerData(oSettings.sAjaxSource, null, function(json) {
               /* Clear the old information from the table */
               that.oApi._fnClearTable(oSettings);

               /* Got the data - add it to the table */
               for (var i = 0; i < json.aaData.length; i++) {
                   that.oApi._fnAddData(oSettings, json.aaData[i]);
               }

               oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();
               that.fnDraw(that);
               that.oApi._fnProcessingDisplay(oSettings, false);

               /* Callback user function - for event handlers etc */
               if (typeof fnCallback == 'function') {
                   fnCallback(oSettings);
               }
           });
       };



//Timer
function AutoReload(){
 CheckInfoDate();
 setTimeout(function(){AutoReload();}, 50000);
}

function CheckInfoDate(){
   $.ajax({
               type: "POST",
               url: "MyPage.aspx/CheckDate",
               contentType: "application/json; chartset=utf-8",
               dataType: "json",
               success: function (data) { ProcessResult(data.d); },
               error: function (orjRequest){ ErrorHandler(); }
         });
       }

      function ErrorHandler() {
           window.location.href = "../Login.aspx";
       }

       function ProcessResult(result) {
           if (result != "False") {
               RefreshDataTable();
           }
       }

      function RefreshDataTable() {
               table1.fnReloadAjax();
       }

//MyPage.aspx.cs
[WebMethod(Description="Read Date from Database")]
public static String CheckDate()
{
  //Basic SQL read from database and return as string
  return DBCustomClass.CheckInfoDate().ToString();
}

我收到的错误日志是:

来源:http://localhost:8080/MyPage.aspx/CheckDate System.Web.HttpException:发送 HTTP 标头后无法重定向。
在 System.Web.HttpResponse.Redirect(String url, Boolean endResponse)
在 System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 在 System.Web.HttpApplication.ExecuteStep(IExecutionStep 步骤,布尔和完成同步)

任何帮助,将不胜感激。

4

1 回答 1

0

虽然复发很少见,但其他时间是一致的(但不可重复)。我会将这个问题标记为已解决。

于 2013-07-03T09:06:41.350 回答