问题描述
我正在处理一个经典的 ASP 项目,当我从 DB 填充数据并将其绑定到 UI 中时,我遇到了超时问题.我们得到以下错误:脚本超时超出了脚本 tp 执行的最长时间.您可以通过为属性 Server.Scripttimeout 指定新值或通过更改 IIS 管理工具中的值来更改此限制
I am working on a classic ASP project where I am getting time out issue when populating the data from DB and Bind it in the UI. The following error we got: Script timeout The maximum amount of time for a script tp execute was exceeded. You can change this limit by specifying new value for the property Server.Scripttimeout or by changing the value in IIS asministration tools
为了解决这个问题,我们尝试进行分页,但没有成功.一个页面上有多个表单,它们具有单独的名称(即 form1、
form2
).我们在一个特定的表单中实现了 Recordset
分页.除了分页,编辑和删除选项也可用于记录集中的特定记录.我们面临的问题是,当我们尝试编辑记录时,表单值不会出现在发布的页面中.
To resolve the issue we tried to do the pagination but it went unsuccessful.
There are several forms on one page with individual names (i.e. form1
, form2
) . We have implemented Recordset
pagination within one particular form.
Along with the pagination edit and delete options are also available for a particular record in record set. The problem what we are facing is when we try to edit the record the form values are not coming to the posted page.
我提到的代码片段如下:
I have mentioned the code snippet as below:
Function someFunction
data1=""
<form name="Xyz" method="post" action="edit.asp">
s=s&"<script>function relsubmit() {alert(" & data1 &"); rjob.submit(); } </script>"
'Pagination code display only 30 records per page
Do While Not ( rss.Eof Or rss.AbsolutePage <> iPage )
'some code
If (Action="RELEdit") Then
s=s&"" & drsel &""
s=s&"
s=s&"" & clean(rss.Fields(4).value) & ""
Else
End If
datadr1=datadr1& rss.Fields(0).value & ","
rss.MoveNext
loop
If (Action="RELEdit") then
s=s&"<input type=hidden name=data1 value=""" & datadr1 & "">"
s=s&"<input type=hidden name=data2 value=""" &datadr2 & """><</form>"
End If
End Function
我们尝试使用 request.form("data1")
获取 edit.asp 页面中的值,这些值也为空,我们也在 relsubmit()
中尝试了警报code> 函数显示为空.
We have tried to get the value in edit.asp page using request.form("data1")
the values are coming empty also we tried alert in the relsubmit()
function it is showing as empty.
你能帮我解释一下为什么表单值被发布为 null 或空.另外,如果我们有任何其他方法来跟踪超时,请告诉我.
Can you please help me why the form values are posted as null or empty. Also, please advise me if we have any other approaches to track the time out.
推荐答案
将此代码放在您正在运行的 ASP 页面的顶部.值以秒为单位(300 = 60*5 = 5 分钟)这会将脚本运行时间延长至 5 分钟.你可以设置任何值甚至小时
Place this code at the top of the ASP page you are running. The values are in seconds (300 = 60*5 = 5 minutes) This will extend the script runtime to 5 minutes. You can set any value even hours
<%Server.ScriptTimeout=600%>
这篇关于经典 ASP 中的超时问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!