熟悉asp的请进

lxllamy 2003-09-05 12:13:26
针对添加按钮,如果点击的速度过快,为什么会出现空白页。请看例子。

func.asp

<%
'³öÏÖÌáʾ´°
Function MsgBox(error,n)
Set rs = nothing
Set conn = nothing

Copyright = "\n\n"

Response.write"<html>" & vbcrlf & _
"<head>" & vbcrlf & _
"<title>Ìáʾ</title>" & vbcrlf & _
"<meta http-equiv=""Pragma"" content=""no-cache"">" & vbcrlf & _
"<meta http-equiv=""Content-Language"" content=""zh-cn"">" & vbcrlf & _
"<meta http-equiv=""Content-Type"" content=""text/html; charset=gb2312"">" & vbcrlf & _
"</head>" & vbcrlf & _
"<style>" & vbcrlf & _
"body{margin:0px;scrollbar-face-color:buttonface;scrollbar-highlight-color:buttonface;scrollbar-shadow-color:buttonface;scrollbar-3dlight-color:buttonhighlight;scrollbar-arrow-color:#797979;scrollbar-track-color:#EEEEEE;scrollbar-darkshadow-color:buttonshadow}" & vbcrlf & _
"body,a,table,div,span,td,th,input,select{font:9pt;font-family: ""ËÎÌå"", Verdana, Arial, Helvetica, sans-serif;}" & vbcrlf & _
"</style>" & vbcrlf & _
"<body>" & vbcrlf & _
"<script language=""javascript"">" & vbcrlf

If DateDiff("s",Session("MsgBoxTime"),now()) > 4 or Session("MsgBoxTime") = "" then
Session("MsgBoxTime") = now()
If not error = "" then
Response.write "alert('" & Replace(error,"'","\'") & Copyright & "');" & vbcrlf
End If
If Vartype(n) = 2 then
If n = 1 then '1=ºóÍË
Response.write "history.go(-1);" & vbcrlf
End If
If n=3 then '3=Ë¢ÐÂÖ÷´°¿Ú
Response.write "parent.top.location.reload();" & vbcrlf
End If
If n=4 then '4=ˢи¸´°¿Ú
Response.write "opener.location.reload();" & vbcrlf
End If
If n=2 then '2=¹Ø±Õ
Response.write"document.write('<OBJECT id=closes type=""application/x-oleobject"" classid=""clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"">');" & vbcrlf & _
"document.write('<param name=""Command"" value=""Close"">');" & vbcrlf & _
"document.write('</object>');" & vbcrlf & _
"closes.Click();" & vbcrlf & _
"window.close();" & vbcrlf
End If
End If
If Vartype(n) = 8 then '"CHAR"=·µ»ØÖ¸¶¨Â·¾¶
Response.write "window.location.href='" & n & "';" & vbcrlf
End If
End If

Response.write"</script>" & vbcrlf & _
"</body>" & vbcrlf & _
"</html>"
Response.end
End Function
%>

erg.asp

<!--#include file="func.asp" -->
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<%
if Request("AddBtn")="Ìí¼Ó" then
call MsgBox("µ³ÅɱàºÅ²»ÄÜΪ¿Õ",1)
end if
%>
<form name="form1" method="post" action="">
<table width="95%" border="0" align="center" cellpadding="2">
<tr bgcolor="FFF8FF">
<td width="40%" align="right">µ³ÅÉÃû³Æ</td>
<td width="60%" height="25"><input name="ClanName" type="text" id="ClanName" maxlength=20></td>
</tr>
<tr bgcolor="FFF8FF">
<td align="right">µ³ÅÉÃû³Æ±àÂë</td>
<td height="25"><input name="ClanNum" type="text" id="ClanNum" maxlength=20></td>
</tr>
<tr align="center" bgcolor="F3F7FF">
<td height="35" colspan="2"><input name="AddBtn" type="submit" id="AddBtn" value="Ìí¼Ó">
¡¡
<input name="CannelBtn" type="submit" id="CannelBtn" value="È¡Ïû"></td>
</tr>
</table>
</form>
</body>
</html>
...全文
27 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

28,404

社区成员

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

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