定时刷新网页

pangxiaoya 2003-12-02 12:00:19
我用<meta http-equiv="refresh" content="10" ;URL="PEISONG.asp">
隔10秒钟刷新一次,怎么显示“不重新发送消息,则无法刷新网页等”怎么会事啊,请问怎样解决啊?
谢谢!
...全文
89 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
clon 2003-12-02
  • 打赏
  • 举报
回复
setInterval和setTimeout有什么区别?
monkeys 2003-12-02
  • 打赏
  • 举报
回复
楼主这问题!好
possible_Y 2003-12-02
  • 打赏
  • 举报
回复
<script language="JavaScript">
function xxx()
{
window.location=window.location;
}
setInterval('xxx()',10000);
</script>
freespace520 2003-12-02
  • 打赏
  • 举报
回复
简单的说,你要刷新的这个页面,是有表单提交的,所以当页面刷新时就会这样!
pangxiaoya 2003-12-02
  • 打赏
  • 举报
回复
peisong2.asp<%@ Language=VBScript %>
<%option explicit%>
<%Response.Expires=0%>
<!--#include file="AdoAccess.asp"-->
<script language=vbscript>
<!--
'输入值非空以及text3是否为数据值的判断
function form1_onsubmit()
if form1.text1.value=""then
MsgBox"请输入值,不能为空"
form1.text1.focus()
form1_onsubmit=false
exit function
elseif form1.text2.value=""then
MsgBox"请输入值,不能为空"
form1.text2.focus()
form1_onsubmit=false
exit function
elseif form1.text3.value=""then
MsgBox"请输入值,不能为空"
form1.text3.focus()
form1_onsubmit=false
exit function
elseif form1.text4.value=""then
MsgBox"请输入值,不能为空"
form1.text4.focus()
form1_onsubmit=false
exit function
end if
if not IsNumeric(form1.text3.value)then
MsgBox"请输入数值!"
form1_onsubmit=false
form1.text3.focus()
exit function
end if
form1_onsubmit=true


end function

-->
</script>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<p align="center"><font face="方正舒体"><font size="5"><strong>配送令单</strong></font></font>
</p>

<%if Request.Form.Count=0 then
session("id")=Request("id")
%>
<form action=peisong2.asp method=post id=form1 name=form1>

<table border="3" align="center">
<TBODY>
<tr>
<td>
<%Response.Write"令单ID"&"</td>"
Response.Write "<td>"&"物料图号"&"</td>"
Response.Write "<td>"&"物料名称"&"</td>"
Response.Write "<td>"&"附件数量"&"</td>"
Response.Write "<td>"&"备注"&"</td>"
Response.Write"</tr>"
Response.Write "<tr>"
Response.Write "<td>"&session("id")&"</td>"
Response.Write "<td>"%><INPUT id=text1 name=drawingid size=15>
<%Response.Write "</td>"
Response.Write "<td>"%><INPUT id=text2 name=name size=15>
<%Response.Write "</td>"
Response.Write "<td>"%>
<INPUT id=text3 name=account size=15>
<%Response.Write "</td>"
Response.Write "<td>"%>
<INPUT id=text4 name=remark size=15>
<%Response.Write "</td>"
Response.Write"</tr>"
Response.Write "</table>"
%>
<P> </P>
<P> </P>
<P>  <INPUT id=submit1 name=submit1 type=submit value=加入数据库>                                                
<INPUT id=reset1 name=reset1 type=reset value=取消 style="HEIGHT: 25px; WIDTH: 111px"></P>
</form>
<%else
'从form窗体中取得数据
dim drawingid,name,account,remark,i
drawingid=Request.Form("drawingid")
name=Request.Form("name")
account=Request.Form("account")
remark=Request.Form("remark")
'数据库连接以及sql语句
dim cn,rstest,strsql,strsql2,strsql3
set cn=server.CreateObject ("ADODB.Connection")
cn.Open strcn

'在sDISTRIBUTIONACCESSORIES表中插入数据
strsql2="INSERT INTO sDISTRIBUTIONACCESSORIES (DISTRIBUTIONID,DRAWINGID,NAME,REMARK,ACCOUNT) VALUES ('"&session("id")&"','"&drawingid&"','"&name&"','"&remark&"','"&account&"')"
'strsql2="UPDATE sDISTRIBUTIONACCESSORIES SET DRAWINGID='"&drawingid&"',NAME='"&name&"',ACCOUNT='"&account&"',REMARK='"&remark&"' WHERE DISTRIBUTIONID='"&session("id")&"'"
'改写sDISTRIBUTION表中DISTRIBUTIONSTATE的值为在借
strsql3="UPDATE sDISTRIBUTION SET DISTRIBUTIONSTATE='在借' WHERE DISTRIBUTIONID='"&session("id")&"'"
cn.Execute strsql2
cn.Execute strsql3
'刀具配送完毕,显示该id的sDISTRIBUTIONACCESSORIES表记录
strsql="SELECT * FROM sDISTRIBUTIONACCESSORIES where (DISTRIBUTIONID='"&session("id")&"'and DRAWINGID='"&drawingid&"'and NAME='"&name&"'and ACCOUNT='"&account&"'and REMARK='"&remark&"')"
set rstest=server.CreateObject ("ADODB.recordset")
rstest.Open strsql,cn,3,3,1%>

<table border="3" align="center">
<tr>
<td>
<%Response.Write"令单ID"%>
</td>
<td>
<%Response.Write "物料图号"%>
</td>
<td>
<%Response.Write"物料名称"%>
</td>
<td>
<%Response.Write"附件数量"%>
</td>
<td>
<%Response.Write"备注"%>
</td>
</tr>
<%
for i=0 to rstest.Fields.Count-1
Response.Write"<td>"&rstest(i).value&"</td>"
next
Response.Write"</tr>"
Response.Write "</table>"
rstest.Close
cn.Close
set rstest=nothing
set cn=nothing
end if


%>
<P> 
<P></P>
<A href="peisong.asp">返回配送页面</A>
<P></P>
<P></P></P></table></TD></TR></TBODY></TABLE>



</BODY>
</HTML>

pangxiaoya 2003-12-02
  • 打赏
  • 举报
回复
peisong.asp
<%@ Language=VBScript %>
<%option explicit%>
<!--#include file="AdoAccess.asp"-->

<%Response.Expires=0%>

<html>
<title>令单配送</title>
<head>
<LINK rel="stylesheet" type="text/css" href="cssfiles/PublicStyle.css">
<meta http-equiv="refresh" content="10";URL="PEISONG.asp">
</head>
<body>
<p align="center"><font face="方正舒体"><font size="5"><strong>令单配送</strong>
</font></font></p>

<%

const MaxPerPage=10
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
'数据库连接
dim cn,rs,strsql,strsql2,strsql3,rstest2
set cn=server.CreateObject ("ADODB.Connection")
cn.Open strcn
'查询sDISTRIBUTION中DISTRIBUTIONSTATE='申请'的记录
strsql="SELECT DISTRIBUTIONID,PAIGONGHAO,PLANMODAL,PARTDRAWINGID,PROCROUTING,ASSESSCLASS FROM sDISTRIBUTION WHERE DISTRIBUTIONSTATE='申请'"
'每次刷新时显示新出现的申请记录其中SHUAXINSTATE='1'
strsql2="SELECT DISTRIBUTIONID FROM sDISTRIBUTION WHERE (SHUAXINSTATE='1'and DISTRIBUTIONSTATE='申请')"
'显示新出现的申请记录后将其中SHUAXINSTATE改为0
strsql3="UPDATE sDISTRIBUTION SET SHUAXINSTATE='0' WHERE DISTRIBUTIONSTATE='申请'"
set rs=server.CreateObject ("ADODB.recordset")
set rstest2=server.CreateObject ("ADODB.recordset")
rstest2.Open strsql2,cn,3,3,1
'有新的令单出现时,提示信息
if rstest2.RecordCount>0 then
do while not rstest2.eof
%>

<SCRIPT LANGUAGE = VBScript>

MsgBox "有新的令单出现,令单ID为:"& "<%=rstest2("DISTRIBUTIONID")%>"

</SCRIPT>


<%rstest2.MoveNext
loop
end if
rstest2.Close
set rstest2=nothing
rs.Open strsql,cn,3,3,1

'分页
'数据指针移到第一条
if not rs.EOF <>0 then
rs.MoveFirst
end if
rs.pagesize=MaxPerPage
dim howmanyfields
howmanyfields=rs.Fields.Count-1

If trim(Request("Page"))<>"" then
CurrentPage= CLng(request("Page"))
If CurrentPage> rs.PageCount then
CurrentPage = rs.PageCount
End If
Else
CurrentPage= 1
End If

if rs.eof then
response.write "<p align='center'> 没有新的配送令单!</p>"
else
totalPut=rs.recordcount
if CurrentPage<>1 then
if (currentPage-1)*MaxPerPage<totalPut then
rs.move(currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
end if
end if

dim n,k
if (totalPut mod MaxPerPage)=0 then
n= totalPut \ MaxPerPage
else
n= totalPut \ MaxPerPage + 1
end if%>

<p align="center">PAGE <%=currentpage%> OF <%=n%> 共<%=rs.recordcount%> 纪录
<% k=currentPage
if k<>1 then
response.write "[<b>"+"<a href='PEISONG.asp?page=1'>首页</a></b>] "
response.write "[<b>"+"<a href='PEISONG.asp?page="+cstr(k-1)+"'>上一页</a></b>] "
else
Response.Write "[首页] [上一页]"
end if
if k<>n then
response.write "[<b>"+"<a href='PEISONG.asp?page="+cstr(k+1)+"'>下一页</a></b>] "
response.write "[<b>"+"<a href='PEISONG.asp?page="+cstr(n)+"'>尾页</a></b>] "
else
Response.Write "[下一页] [尾页]"
end if
'记录显示
%>

</p>


<table border="3" align="center">
<tr>
<td align="center" >
<%Response.Write"编辑"%>
</td>
<td align="center" >
<%Response.Write "令单ID"%>
</td>
<td align="center" >
<%Response.Write "派工号"%>
</td>
<td align="center" >
<%Response.Write "计划类型"%>
</td>
<td align="center" >
<%Response.Write "零件图号"%>
</td>
<td align="center" >
<%Response.Write "工艺路线"%>
</td>
<td align="center" bgcolor="#c0c0c0">
<%Response.Write "考核类型"%>
</td>
<%

i=0
do while not rs.eof and i<maxperpage%>
<tr align="middle">
<td>
<a HREF="peisong2.asp?id=<%=rs("DISTRIBUTIONID")%>">编辑</a>
</td>
<%for j=0 to howmanyfields%>

<td>
 <%=rs(j)%> 
</td>
<%next%>
</tr>
<%
i=i+1
rs.movenext
loop
%>
</table>
<%cn.Execute strsql3
rs.close
cn.Close
set rs=nothing
end if

%>
</body>
</html>

28,405

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧