碰到一个问题,不知道如何解决,求大侠指点。
具体描述如下:
由于存储过程执行时间太长,需要一分多钟,然后asp.net页面就一直处于等待状态,没有响应。
function函数收不到回发的数据,没有任何提示。
附上handler页面代码及前台js代码。
handler页面部分代码:
try
{
SQLCollector sqlc = new SQLCollector();
sqlc.RunProcedure(strProcName, paras, "dsTable", 0);
context.Response.Write(JsonConvert.SerializeObject(new { success = "true" }));
}
js 部分代码
$.ajax({
type: "post",
url: strUrl,
data: { Date: strDate },
dataType: "json",
success: function (data)
{
//alert(data.success);
document.getElementById("load").style.display = "none";
if (data.success) {
alert("保存成功并计算成功!");
}
else {
alert("保存成功但计算失败!");
}
}
});
有做过如下尝试,依然解决不了该问题:
a. 将command.timeout 的值设为0,不限制执行时间。
b.将web.config 的连接字符串的 connect timeout设为1000