还有人吗?

a32a32a32 2006-09-27 12:00:50
帮我看看,ASP的参数(condition)怎么没传来?不好意思没分了
//////////////////////////////页面代码/////////////////////////////
<!--#include file="conlib.asp"-->
<%
dim no_bookshelf,ISBN,BookName,subName,pubName,Writer
dim lblname,unid,Pages,condition
no_bookshelf=trim(request("no_bookshelf"))
Writer=trim(request("Writer"))
ISBN=trim(request("ISBN"))
BookName=trim(request("BookName"))
subName=trim(request("subName"))
pubName=trim(request("pubName"))
condition=request.form("condition2")
response.write "0."&condition&"<br>"
if (no_bookshelf<>"")then no_bookshelf="code like '%"&no_bookshelf&"%' "end if
if (Writer<>"")then Writer="Writer like '%"&Writer&"%' " end if
if (ISBN<>"")then ISBN="bookISBN like '%"&ISBN&"%' " end if
if (BookName<>"")then BookName="Name like '%"&BookName&"%'" end if
if (subName<>"")then
subName=left(subName,len(subName)-1)
subName=replace(subName,"|","%' or sortcode like '%")
subName="sortcode like'%"&subName&"%' "
end if
if (pubName<>"")then
pubName=left(pubName,len(pubName)-1)
pubName=replace(pubName,"|","%' or publisher like '%")
pubName="publisher like'%"&pubName&"%' "
end if
condition1=no_bookshelf&Writer&ISBN&BookName&subName&pubName
response.write "1."&condition1&"<br>"

if condition="" then
condition=" "&no_bookshelf&Writer&ISBN&BookName&subName&pubName&" "
condition=replace(condition,"'%","""%")
condition=replace(condition,"%'","%""")
end if
response.write "2."&condition&"<br>"
'response.write sql_pub





'condition="name like ""%数学%"" or name like ""%语文%"""
lblname="bookinfo"
Unid="id"
if request("page")="" then
CurrentPage=1
else
CurrentPage=int(Request("page"))
end if
MaxperPage=10
sql1=" declare @p int exec sp_page "&lblname&","&unid&",0,0,'*',"&MaxperPage&","¤tPage&",'"&condition&"',@p out"
response.Write "3."&sql1
set rs=conn.execute (sql1)

sql="Select Count(*) from "&lblname
curPages=conn.execute (sql)(0)
Pages=Round(curPages/MaxperPage,0)+1

%>
<table width="80%" border="0" align="center" cellpadding="2" bgcolor="#CCCCCC">
<tr>
<td width="19%" height="10%" bgcolor="#6688e3"><div align="center">编号</div></td>
<td width="40%" bgcolor="#6688e3"><div align="center">书名</div></td>
<td width="24%" bgcolor="#6688e3"><div align="center">分类</div></td>
<td width="17%" bgcolor="#6688e3"><div align="center">出版社</div></td>
</tr>
<%
do While Not RS.EOF
%>
<tr>
<td bgcolor="#FFFFFF"><div align="center"><%=rs("id")%></div></td>
<td bgcolor="#FFFFFF"><div align="center"><%=rs("name")%></div></td>
<td bgcolor="#FFFFFF"><div align="center"><%=rs("sortcode")%></div></td>
<td bgcolor="#FFFFFF"><div align="center"><%=rs("publisher")%></div></td>
</tr>
<%
RS.MoveNext
loop
%>
</table>

<table width="80%" border="0" align="center">
<form name="form1"action="tt.asp" method="post" >
<input type="hidden" name="condition2" value="<%=condition1%>" id="condition2" />
<tr>
<td height="22"><div align="right">第<%=CurrentPage%>页/<%=Pages%>页
<% if CurrentPage>1 then %>
<a href="tt.asp?Page=<%=CurrentPage-1%>">上一页</a> <% end if %>
<% if CurrentPage<Pages then %>
<a href="tt.asp?Page=<%=CurrentPage+1%>">下一页</a> <% end if %>
 直接到第
<select name="page" CLASS="un_submit">
<%for i=1 to Pages%>
<option value="<%=i%>"><%=i%></option>
<%next%>
</select>

<input type="submit" value="Go" CLASS="un_submit">
</div>
</tr>
</form>
</table>

...全文
85 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
fosjos 2006-09-27
  • 打赏
  • 举报
回复
Pages=Int((curPages+MaxperPage-1)/MaxperPage)
...
<input type="hidden" name="page" value="<%=CurrentPage%>">
<tr>
<td height="22"><div align="right">第<%=CurrentPage%>页/<%=Pages%>页
<% if CurrentPage>1 then %>
<a href="#" onclick="javascript:form.page=<%==CurrentPage-1%>;form.submit()">上一页</a> <% end if %>
<% if CurrentPage<Pages then %>
<a href="#" onclick="javascript:form.page=<%==CurrentPage+1%>;form.submit()">下一页</a> <% end if %>
 直接到第
<select CLASS="un_submit" onchange="javascript:form.page=this.value;">
...
用链接方式跳转页面,不提交form里的元素

28,391

社区成员

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

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