将查询结果导出excel表,并刷新原来页面 问题,急需帮助

时间:2023-02-05 16:31:33
我从cuijiandongzhidan.asp 中点击按钮,跳转到cuijiandongzhidan_add.asp,在cuijiandongzhidan_add.asp中导出excel表,并刷新cuijiandongzhidan.asp ,现在导出excel表,没有问题,但是刷新cuijiandongzhidan.asp 没有实现,如何处理?请帮助



cuijiandongzhidan_add.asp

<!-- #include file="../inc/key.asp" -->
<!-- #include file="../inc/conn.asp" -->
<!-- #include file="../inc/rizitianjia.asp"-->
<%
  sybm=request("sybm")
  sydd=request("sydd")
  jdyf=request("jdyf")
  syr=request("syr")
  set rs_cjtzd_add=server.CreateObject("ADODB.recordset")
  sql_cjtzd_add="{call cuijiantongzhidan_add('"&Request("sybm")&"','"&Request("sydd")&"','"&Request("syr")&"','"&Request("jdyf")&"','"&Date()&"')}"
  rs_cjtzd_add.open sql_cjtzd_add,conn 
  caozuo="生成 使用人:"&request("syr")&",检定月份:"&request("jdyf")&" 催检单"
  call rizi_add
  set rs_cjtzd_add = nothing
  nowfilename=sybm&sydd&syr&jdyf&"催检通知单"
  Response.Buffer = True 
  Response.ContentType = "application/vnd.ms-excel" 
  Response.AddHeader "content-disposition", "inline; filename = "&nowfilename&".xls"
%>
<html> 
<head> 
</head> 
<body>
<%
'取得搜索关键字
  set rs_cjtzd =server.createobject("ADODB.RecordSet")
  sql_cjtzd="select * from jdjzjh where sybm='"&sybm&"' and sydd='"&sydd&"' and syr='"&syr&"' and jdyf='"&jdyf&"'"
  rs_cjtzd.open sql_cjtzd,conn,1,1
%>
<table width="100%" border="1" align="center" cellpadding="2" cellspacing="0">
<tr>
  <th>序号</th>
  <th>专业类别</th>
  <th>测量设备种类</th>
  <th>测量设备名称</th>
  <th>型号规格</th>
  <th>测量范围</th>
 </tr>
<%
i=0
do while rs_cjtzd.eof=false
i=i+1
%>
<tr>
  <td align="center"><%=i%></td>
  <td align="center"><%="'"&rs_cjtzd("zylb")%></td>
  <td align="center"><%="'"&rs_cjtzd("clsbzl")%></td>
  <td align="center"><%="'"&rs_cjtzd("clsbmc")%></td>
  <td align="center"><%="'"&rs_cjtzd("xhgg")%></td>
  <td align="center"><%="'"&rs_cjtzd("clfw")%></td>
</tr> 
<%
rs_cjtzd.movenext
loop
  Response.write("<script language='javascript'>;window.close();window.parent.location.replace('cuijiantongzhidan.asp?page="+request("page")+"');alert('数据保存成功!');</script>")

%>     
</table>
</body>
</html>

5 个解决方案

#1


因为 loop 后的response.write 已经输出成excel 了, 不会在浏览器中运行.
你最好使用 ajax 传递表单到 cuijiandongzhidan_add.asp, 在cuijiandongzhidan.asp 页面中实现刷新.

#2


能否说的详细些

#3


从cuijiandongzhidan.asp 中点击按钮时就执行本页刷新啊。

#4


从cuijiandongzhidan.asp 中点击按钮时就执行本页刷新,请问在哪里加刷新本页


cuijiandongzhidan.asp
<!-- #include file="../inc/key.asp" -->
<!-- #include file="../inc/conn.asp" -->
<!-- #include file="../inc/const.asp" -->
<html>
<head>
<title>催检通知单</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../style/style.css" rel="stylesheet" type="text/css">
<style>
body {
background-color:#FFFFFF;
}
</style>
<script language="javascript">
function collapse(img, objName)
{
var obj;
obj = document.getElementById(objName);
if (img.src.indexOf('open') != -1)
{
img.src = img.src.replace('open', 'close');
obj.style.display = 'none';
}
else
{
img.src = img.src.replace('close', 'open');
obj.style.display = '';
}
}

function collapseall(img)
{
var obj;
if (img.src.indexOf('open') != -1)
{
img.src = img.src.replace('open', 'close');
for (x=1;x<=20;x++)
{
obj = document.getElementById("cuijiantongzhidan"+x);
if (obj)
{
obj.style.display = 'none';
}
}
}
else
{
img.src = img.src.replace('close', 'open');
for (x=1;x<=20;x++)
{
obj = document.getElementById("cuijiantongzhidan"+x);
if (obj)
{
obj.style.display = '';
}
}
}
}
function cuijiantongzhidan(sybm,sydd,syr,jdyf,page)
{
  document.getElementById('cjtzd').src = "cuijiandongzhidan_add.asp?sybm="+sybm+"&sydd="+sydd+"&syr="+syr+"&jdyf="+jdyf+"&page="+page;
}
</script>
</head>
<body oncontextmenu="return false">
<%
if fla49="0" then
%>
<br><center><img src="../images/note.gif" align="absmiddle">&nbsp;<font color="#FF0000">你不具备此权限,请与管理员联系!</font></center>
<%  
  response.end
end if

'取得当前页码
currentpage=request("page")
if currentpage<1 or currentpage="" then
  currentpage="1"
end if

'取得搜索关键字
nowsearch=request("search")
nowkeyword=request("keyword") 
%>
<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
<form name="form2">
  <tr> 
    <td width="30%"align="right"><td>
    <td width="70%"align="right">
  查询字段:
      <select name="search" id="search" >
     <option value="" selected="selected"></option>
         <option value="sybm">使用部门</option>
         <option value="sydd">使用地点</option>  
         <option value="syr">使用人</option>
          <option value="jdyf">检定月份</option>
  </select>
  关键字:
  <input type="text" name="keyword" size="20" >
  <input type="hidden" name="hid" value="ok">
  <input type="submit" value=" 查询 " class="button">&nbsp;
</td>
  </tr>
</form>  
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#C4D8ED">
<tr>
<td><img src="../images/r_1.gif" alt="" /></td>
<td width="100%" background="../images/r_0.gif">
  <table cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td>&nbsp;催检通知单&nbsp;&nbsp;</td>
  <td align="right">&nbsp;</td>
    </tr>
  </table>
</td>
<td><img src="../images/r_2.gif" alt="" /></td>
</tr>
<tr>
<td></td>
<td>
<!--startprint-->
<table align="center" cellpadding="4" cellspacing="1" class="toptable grid" border="1">
<form name="form1" >
  <input type="hidden" name="search" value="<%=nowsearch%>">
  <input type="hidden" name="keyword" value="<%=nowkeyword%>">
  <input type="hidden" name="order1" value="<%=request("order1")%>">
  <input type="hidden" name="order2" value="<%=request("order2")%>">
  <input type="hidden" name="order3" value="<%=request("order3")%>">
  <input type="hidden" name="order4" value="<%=request("order4")%>">
  <tr align="center">
    <td class="category" height="30">
  <a href="../zhouqijihua/?order1=<%if request("order1")="asc" then%>desc<%else%>asc<%end if%>&page=<%=currentpage%>&search=<%=nowsearch%>&keyword=<%=nowkeyword%>" class="title">使用部门
  <%if request("order1")="asc" then%><img src="../images/up2.gif" border="0" hspace="2" align="absmiddle"><%else%><img src="../images/down2.gif" border="0" hspace="2" align="absmiddle"><%end if%></a> </td>
<td class="category">
  <a href="../zhouqijihua/?order2=<%if request("order2")="asc" then%>desc<%else%>asc<%end if%>&page=<%=currentpage%>&search=<%=nowsearch%>&keyword=<%=nowkeyword%>" class="title">使用地点
  <%if request("order2")="asc" then%><img src="../images/up2.gif" border="0" hspace="2" align="absmiddle"><%else%><img src="../images/down2.gif" border="0" hspace="2" align="absmiddle"><%end if%></a>    </td>
<td class="category">
  <a href="../zhouqijihua/?order3=<%if request("order3")="asc" then%>desc<%else%>asc<%end if%>&page=<%=currentpage%>&search=<%=nowsearch%>&keyword=<%=nowkeyword%>" class="title">使用人
  <%if request("order3")="asc" then%><img src="../images/up2.gif" border="0" hspace="2" align="absmiddle"><%else%><img src="../images/down2.gif" border="0" hspace="2" align="absmiddle"><%end if%></a> </td>
<td class="category">
  <a href="../zhouqijihua/?order4=<%if request("order4")="asc" then%>desc<%else%>asc<%end if%>&page=<%=currentpage%>&search=<%=nowsearch%>&keyword=<%=nowkeyword%>" class="title">检定月份
  <%if request("order4")="asc" then%><img src="../images/up2.gif" border="0" hspace="2" align="absmiddle"><%else%><img src="../images/down2.gif" border="0" hspace="2" align="absmiddle"><%end if%></a></td>
<td class="category">数量</td>
<td class="category">生成催检单</td>
  <%
  set rs_cjtzd =server.createobject("ADODB.RecordSet")
  sql_cjtzd= "Select DISTINCT syr, sybm, sydd, jdyf from jdjzjh where cjtzd is null"
  if nowsearch<>"" and nowkeyword<>"" then
     sql_cjtzd="sSelect DISTINCT syr, sybm, sydd, jdyf from jdjzjh where (cjtzd is null) and "&nowsearch&" like '%"&nowkeyword&"%'"
  end if
  sql_cjtzd=sql_cjtzd&" order by syr" 
  if request("order1")<>"" then
    sql_cjtzd=sql_cjtzd&",sybm "&request("order1")
  elseif request("order2")<>"" then
    sql_cjtzd=sql_cjtzd&",sydd "&request("order2")
  elseif request("order3")<>"" then
    sql_cjtzd=sql_cjtzd&",syr "&request("order3") 
  elseif request("order4")<>"" then
    sql_cjtzd=sql_cjtzd&",jdyf "&request("order4") 
  else
    sql_cjtzd=sql_cjtzd  
  end if
  rs_cjtzd.open sql_cjtzd,conn,1,1
  if not rs_cjtzd.eof then
  rs_cjtzd.pagesize=20
  rs_cjtzd.absolutepage=currentpage
  for currentrec=1 to rs_cjtzd.pagesize
    if rs_cjtzd.eof then
      exit for
    end if
  %>
  <tr onMouseOver="this.className='highlight'" onMouseOut="this.className=''"onDblClick="javascript:var win=window.open('zhouqijihuaxiangxiqingdan_show.asp?syr=<%=rs_cjtzd("syr")%>&jdyf=<%=rs_cjtzd("jdyf")%>','周期计划详细清单','width=853,height=470,top=176,left=161,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=yes'); win.focus()">
<td align="center" height="25"><%=rs_cjtzd("sybm")%></td>
<td align="center"><%=rs_cjtzd("sydd")%></td>
<td align="center"><%=rs_cjtzd("syr")%></td>
<td align="center"><%=rs_cjtzd("jdyf")%></td>
<td align="center"></td>
<td align="center"><input name="add" type="button" class="button"  value="生成催检单" style="cursor:hand;" onClick="cuijiantongzhidan('<%=rs_cjtzd("sybm")%>','<%=rs_cjtzd("sydd")%>','<%=rs_cjtzd("syr")%>','<%=rs_cjtzd("jdyf")%>','<%=currentpage%>')"><iframe id="cjtzd" width="0" height="0" style="visibility:hidden" ></iframe></td>
  </tr>
  <%
    rs_cjtzd.movenext
  next
  else
  %>
  <tr align="center" onMouseOver="this.className='highlight'" onMouseOut="this.className=''">
    <td colspan="16" height="25" align="center" style="color:red"><b>没有找到记录</b></td>
  </tr>
  <%
  end if
  if rs_cjtzd.recordcount>0 then 
  %> 
  <tr>
    <td colspan="16" height="30" class="category">
<table cellpadding=0 cellspacing=0 width="100%">
<tr>
<td width="20%" align="left" style="color:#FF0000;">&nbsp;双击查看周期计划详细清单</td>  
<td width="80%" align="right">
&nbsp;&nbsp;
      <%=rs_cjtzd.recordcount%>&nbsp;条信息&nbsp; 共&nbsp;<%=rs_cjtzd.pagecount%>&nbsp;页&nbsp;
  <%
  nowstart=currentpage-3
  if nowstart<1 then
    nowstart=1
  end if
  nowend=currentpage+3
  if nowend>rs_cjtzd.pagecount then
    nowend=rs_cjtzd.pagecount
  end if
  response.write "&nbsp;<a href='?search="&nowsearch&"&keyword="&nowkeyword&"&page=1&order1="&request("order1")&"&order2="&request("order2")&"&order3="&request("order3")&"&order4="&request("order4")&"&order5="&request("order5")&"&order6="&request("order6")&"&order7="&request("order7")&"' class='page'>最前页</a>&nbsp;"
  for ipage=nowstart to nowend
    if cstr(ipage)=cstr(currentpage) then
      response.write "&nbsp;<span style='font-weight:bold;color:#5858E6'>" & ipage &"</span>&nbsp;"
    else
      response.write "&nbsp;[&nbsp;<a href='?search="&nowsearch&"&keyword="&nowkeyword&"&page="&ipage&"&order1="&request("order1")&"&order2="&request("order2")&"&order3="&request("order3")&"&order4="&request("order4")&"&order5="&request("order5")&"&order6="&request("order6")&"&order7="&request("order7")&"' class='page'>" & ipage &"</a>&nbsp;]&nbsp;"
    end if
  next
  response.write "&nbsp;<a href='?search="&nowsearch&"&keyword="&nowkeyword&"&page="&rs_cjtzd.pagecount&"&order1="&request("order1")&"&order2="&request("order2")&"&order3="&request("order3")&"&order4="&request("order4")&"&order5="&request("order5")&"&order6="&request("order6")&"&order7="&request("order7")&"' class='page'>最后页</a>&nbsp;"
%>
    <select name="page" onChange="form1.action='?';form1.submit();">
<%
for x=1 to rs_cjtzd.pagecount
%>
  <option value="<%=x%>"<%if currentpage=trim(cstr(x)) then%> selected="selected"<%end if%>><%=x%></option>
<%
next
%>
</select>
 </tr></table></td></tr>
<%end if%> 
</form>   
</table>
<!--endprint-->
</td>
<td></td>
</tr>
<tr>
<td><img src="../images/r_4.gif" alt="" /></td>
<td></td>
<td><img src="../images/r_3.gif" alt="" /></td>
</tr>
</table>
</body>
</html>

#5


Response.ContentType = "application/vnd.ms-excel"  
就是说,一旦指定上面这项, 你这个页面的内容都当excel打开了, 所以不会当html去执行.
所以这个 script 也就不会执行了.

#1


因为 loop 后的response.write 已经输出成excel 了, 不会在浏览器中运行.
你最好使用 ajax 传递表单到 cuijiandongzhidan_add.asp, 在cuijiandongzhidan.asp 页面中实现刷新.

#2


能否说的详细些

#3


从cuijiandongzhidan.asp 中点击按钮时就执行本页刷新啊。

#4


从cuijiandongzhidan.asp 中点击按钮时就执行本页刷新,请问在哪里加刷新本页


cuijiandongzhidan.asp
<!-- #include file="../inc/key.asp" -->
<!-- #include file="../inc/conn.asp" -->
<!-- #include file="../inc/const.asp" -->
<html>
<head>
<title>催检通知单</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../style/style.css" rel="stylesheet" type="text/css">
<style>
body {
background-color:#FFFFFF;
}
</style>
<script language="javascript">
function collapse(img, objName)
{
var obj;
obj = document.getElementById(objName);
if (img.src.indexOf('open') != -1)
{
img.src = img.src.replace('open', 'close');
obj.style.display = 'none';
}
else
{
img.src = img.src.replace('close', 'open');
obj.style.display = '';
}
}

function collapseall(img)
{
var obj;
if (img.src.indexOf('open') != -1)
{
img.src = img.src.replace('open', 'close');
for (x=1;x<=20;x++)
{
obj = document.getElementById("cuijiantongzhidan"+x);
if (obj)
{
obj.style.display = 'none';
}
}
}
else
{
img.src = img.src.replace('close', 'open');
for (x=1;x<=20;x++)
{
obj = document.getElementById("cuijiantongzhidan"+x);
if (obj)
{
obj.style.display = '';
}
}
}
}
function cuijiantongzhidan(sybm,sydd,syr,jdyf,page)
{
  document.getElementById('cjtzd').src = "cuijiandongzhidan_add.asp?sybm="+sybm+"&sydd="+sydd+"&syr="+syr+"&jdyf="+jdyf+"&page="+page;
}
</script>
</head>
<body oncontextmenu="return false">
<%
if fla49="0" then
%>
<br><center><img src="../images/note.gif" align="absmiddle">&nbsp;<font color="#FF0000">你不具备此权限,请与管理员联系!</font></center>
<%  
  response.end
end if

'取得当前页码
currentpage=request("page")
if currentpage<1 or currentpage="" then
  currentpage="1"
end if

'取得搜索关键字
nowsearch=request("search")
nowkeyword=request("keyword") 
%>
<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
<form name="form2">
  <tr> 
    <td width="30%"align="right"><td>
    <td width="70%"align="right">
  查询字段:
      <select name="search" id="search" >
     <option value="" selected="selected"></option>
         <option value="sybm">使用部门</option>
         <option value="sydd">使用地点</option>  
         <option value="syr">使用人</option>
          <option value="jdyf">检定月份</option>
  </select>
  关键字:
  <input type="text" name="keyword" size="20" >
  <input type="hidden" name="hid" value="ok">
  <input type="submit" value=" 查询 " class="button">&nbsp;
</td>
  </tr>
</form>  
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#C4D8ED">
<tr>
<td><img src="../images/r_1.gif" alt="" /></td>
<td width="100%" background="../images/r_0.gif">
  <table cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td>&nbsp;催检通知单&nbsp;&nbsp;</td>
  <td align="right">&nbsp;</td>
    </tr>
  </table>
</td>
<td><img src="../images/r_2.gif" alt="" /></td>
</tr>
<tr>
<td></td>
<td>
<!--startprint-->
<table align="center" cellpadding="4" cellspacing="1" class="toptable grid" border="1">
<form name="form1" >
  <input type="hidden" name="search" value="<%=nowsearch%>">
  <input type="hidden" name="keyword" value="<%=nowkeyword%>">
  <input type="hidden" name="order1" value="<%=request("order1")%>">
  <input type="hidden" name="order2" value="<%=request("order2")%>">
  <input type="hidden" name="order3" value="<%=request("order3")%>">
  <input type="hidden" name="order4" value="<%=request("order4")%>">
  <tr align="center">
    <td class="category" height="30">
  <a href="../zhouqijihua/?order1=<%if request("order1")="asc" then%>desc<%else%>asc<%end if%>&page=<%=currentpage%>&search=<%=nowsearch%>&keyword=<%=nowkeyword%>" class="title">使用部门
  <%if request("order1")="asc" then%><img src="../images/up2.gif" border="0" hspace="2" align="absmiddle"><%else%><img src="../images/down2.gif" border="0" hspace="2" align="absmiddle"><%end if%></a> </td>
<td class="category">
  <a href="../zhouqijihua/?order2=<%if request("order2")="asc" then%>desc<%else%>asc<%end if%>&page=<%=currentpage%>&search=<%=nowsearch%>&keyword=<%=nowkeyword%>" class="title">使用地点
  <%if request("order2")="asc" then%><img src="../images/up2.gif" border="0" hspace="2" align="absmiddle"><%else%><img src="../images/down2.gif" border="0" hspace="2" align="absmiddle"><%end if%></a>    </td>
<td class="category">
  <a href="../zhouqijihua/?order3=<%if request("order3")="asc" then%>desc<%else%>asc<%end if%>&page=<%=currentpage%>&search=<%=nowsearch%>&keyword=<%=nowkeyword%>" class="title">使用人
  <%if request("order3")="asc" then%><img src="../images/up2.gif" border="0" hspace="2" align="absmiddle"><%else%><img src="../images/down2.gif" border="0" hspace="2" align="absmiddle"><%end if%></a> </td>
<td class="category">
  <a href="../zhouqijihua/?order4=<%if request("order4")="asc" then%>desc<%else%>asc<%end if%>&page=<%=currentpage%>&search=<%=nowsearch%>&keyword=<%=nowkeyword%>" class="title">检定月份
  <%if request("order4")="asc" then%><img src="../images/up2.gif" border="0" hspace="2" align="absmiddle"><%else%><img src="../images/down2.gif" border="0" hspace="2" align="absmiddle"><%end if%></a></td>
<td class="category">数量</td>
<td class="category">生成催检单</td>
  <%
  set rs_cjtzd =server.createobject("ADODB.RecordSet")
  sql_cjtzd= "Select DISTINCT syr, sybm, sydd, jdyf from jdjzjh where cjtzd is null"
  if nowsearch<>"" and nowkeyword<>"" then
     sql_cjtzd="sSelect DISTINCT syr, sybm, sydd, jdyf from jdjzjh where (cjtzd is null) and "&nowsearch&" like '%"&nowkeyword&"%'"
  end if
  sql_cjtzd=sql_cjtzd&" order by syr" 
  if request("order1")<>"" then
    sql_cjtzd=sql_cjtzd&",sybm "&request("order1")
  elseif request("order2")<>"" then
    sql_cjtzd=sql_cjtzd&",sydd "&request("order2")
  elseif request("order3")<>"" then
    sql_cjtzd=sql_cjtzd&",syr "&request("order3") 
  elseif request("order4")<>"" then
    sql_cjtzd=sql_cjtzd&",jdyf "&request("order4") 
  else
    sql_cjtzd=sql_cjtzd  
  end if
  rs_cjtzd.open sql_cjtzd,conn,1,1
  if not rs_cjtzd.eof then
  rs_cjtzd.pagesize=20
  rs_cjtzd.absolutepage=currentpage
  for currentrec=1 to rs_cjtzd.pagesize
    if rs_cjtzd.eof then
      exit for
    end if
  %>
  <tr onMouseOver="this.className='highlight'" onMouseOut="this.className=''"onDblClick="javascript:var win=window.open('zhouqijihuaxiangxiqingdan_show.asp?syr=<%=rs_cjtzd("syr")%>&jdyf=<%=rs_cjtzd("jdyf")%>','周期计划详细清单','width=853,height=470,top=176,left=161,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=yes'); win.focus()">
<td align="center" height="25"><%=rs_cjtzd("sybm")%></td>
<td align="center"><%=rs_cjtzd("sydd")%></td>
<td align="center"><%=rs_cjtzd("syr")%></td>
<td align="center"><%=rs_cjtzd("jdyf")%></td>
<td align="center"></td>
<td align="center"><input name="add" type="button" class="button"  value="生成催检单" style="cursor:hand;" onClick="cuijiantongzhidan('<%=rs_cjtzd("sybm")%>','<%=rs_cjtzd("sydd")%>','<%=rs_cjtzd("syr")%>','<%=rs_cjtzd("jdyf")%>','<%=currentpage%>')"><iframe id="cjtzd" width="0" height="0" style="visibility:hidden" ></iframe></td>
  </tr>
  <%
    rs_cjtzd.movenext
  next
  else
  %>
  <tr align="center" onMouseOver="this.className='highlight'" onMouseOut="this.className=''">
    <td colspan="16" height="25" align="center" style="color:red"><b>没有找到记录</b></td>
  </tr>
  <%
  end if
  if rs_cjtzd.recordcount>0 then 
  %> 
  <tr>
    <td colspan="16" height="30" class="category">
<table cellpadding=0 cellspacing=0 width="100%">
<tr>
<td width="20%" align="left" style="color:#FF0000;">&nbsp;双击查看周期计划详细清单</td>  
<td width="80%" align="right">
&nbsp;&nbsp;
      <%=rs_cjtzd.recordcount%>&nbsp;条信息&nbsp; 共&nbsp;<%=rs_cjtzd.pagecount%>&nbsp;页&nbsp;
  <%
  nowstart=currentpage-3
  if nowstart<1 then
    nowstart=1
  end if
  nowend=currentpage+3
  if nowend>rs_cjtzd.pagecount then
    nowend=rs_cjtzd.pagecount
  end if
  response.write "&nbsp;<a href='?search="&nowsearch&"&keyword="&nowkeyword&"&page=1&order1="&request("order1")&"&order2="&request("order2")&"&order3="&request("order3")&"&order4="&request("order4")&"&order5="&request("order5")&"&order6="&request("order6")&"&order7="&request("order7")&"' class='page'>最前页</a>&nbsp;"
  for ipage=nowstart to nowend
    if cstr(ipage)=cstr(currentpage) then
      response.write "&nbsp;<span style='font-weight:bold;color:#5858E6'>" & ipage &"</span>&nbsp;"
    else
      response.write "&nbsp;[&nbsp;<a href='?search="&nowsearch&"&keyword="&nowkeyword&"&page="&ipage&"&order1="&request("order1")&"&order2="&request("order2")&"&order3="&request("order3")&"&order4="&request("order4")&"&order5="&request("order5")&"&order6="&request("order6")&"&order7="&request("order7")&"' class='page'>" & ipage &"</a>&nbsp;]&nbsp;"
    end if
  next
  response.write "&nbsp;<a href='?search="&nowsearch&"&keyword="&nowkeyword&"&page="&rs_cjtzd.pagecount&"&order1="&request("order1")&"&order2="&request("order2")&"&order3="&request("order3")&"&order4="&request("order4")&"&order5="&request("order5")&"&order6="&request("order6")&"&order7="&request("order7")&"' class='page'>最后页</a>&nbsp;"
%>
    <select name="page" onChange="form1.action='?';form1.submit();">
<%
for x=1 to rs_cjtzd.pagecount
%>
  <option value="<%=x%>"<%if currentpage=trim(cstr(x)) then%> selected="selected"<%end if%>><%=x%></option>
<%
next
%>
</select>
 </tr></table></td></tr>
<%end if%> 
</form>   
</table>
<!--endprint-->
</td>
<td></td>
</tr>
<tr>
<td><img src="../images/r_4.gif" alt="" /></td>
<td></td>
<td><img src="../images/r_3.gif" alt="" /></td>
</tr>
</table>
</body>
</html>

#5


Response.ContentType = "application/vnd.ms-excel"  
就是说,一旦指定上面这项, 你这个页面的内容都当excel打开了, 所以不会当html去执行.
所以这个 script 也就不会执行了.