chg148 chg148
关注数: 12 粉丝数: 147 发帖数: 104 关注贴吧数: 14
请教asp高手 关于变量的跨页调用?? 下面是news.asp(文章列表页)的代码!!您现在的位置是:首页 - <%=class_name%>他可以调用, 我在news_info.asp(内容页)调用<%=class_name%>无法显示 ?就是在内容页上显示当前内容的栏目名称 请求方法 谢谢!! news.asp代码在下面: <!--#include file="conn.asp"--> <!--#include file="config.asp"--> <% typeid=request("class_id") big_id=request("big_id") if big_id="" then response.write "<script>alert('参数错误,点击返回首页!');window.location.href='/index.asp';</script>" elseif typeid="" and big_id="3" then class_name="体检常识" elseif typeid="" and big_id="5" then class_name="专项体检" else set rs=conn.execute("select * from new_class where class_id="&typeid) class_name=rs("class_name") rs.close:set rs=nothing end if %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fwww.w3.org%2FTR%2Fxhtml1%2FDTD%2Fxhtml1-transitional.dtd&urlrefer=e9b2a1e0c6d358d677c4ee0138b67400"> <html xmlns="http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml&urlrefer=d0f4243b5ce5e5fa54fdafc10831c319"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title><%=class_name%>-<%=webtitle%></title> <Meta http-equiv="Content-Language" Content="zh-cn"> <LINK href="css.css" type=text/css rel=stylesheet> </head> <body> <body onselectstart="return false"> <!--#include file="top.asp"--> <table width="950" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="740" valign="top"> <table width="98%" border="1" cellpadding="0" cellspacing="0" bordercolor="#A7CBE5" class="small_table"> <tr> <td height="450" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#E7F5FE"> <tr> <td width="19" height="26" align="center"><img src="images/list_001.gif" width="13" height="11" /></td> <td width="537">您现在的位置是:首页 - <%=class_name%></td> </tr> </table> <%if big_id="3" or big_id="5" then%> <%end if%> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="7%" height="20" align="center"><img src="images/icon_001.gif" width="13" height="13" /></td> <td width="93%" align="left" class="td_title"><%=class_name%></td> </tr> </table> <table width="96%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="efefef"> <tr> <td width="35%" height="2" bgcolor="#66A6DB"></td> <td width="79%"></td> </tr> </table> <table width="96%" border="0" cellpadding="0" cellspacing="0"> <% set rs=server.createobject("adodb.recordset") if typeid="" then sql="select * from news where big_id="&big_id&" Order BY new_time desc" else sql="select * from news where class_id="&typeid&" and zt=true Order BY new_time desc" end if rs.open sql,conn,1,1 page=request("page") pagesize=30 rs.pagesize=pagesize totalpro=rs.recordcount pagenum=rs.pagecount if page="" or clng(page)<0 then page=1 if clng(page)>pagenum then page=pagenum if page>0 then rs.Absolutepage=page if rs.eof and rs.bof then response.write "<tr><td colspan=3 align=center>暂无记录</td></tr>" else count=0 do while not (rs.eof or rs.bof) and count<rs.pagesize %> <tr> <td width="3%" height="25" align="center"> </td> <td width="97%" align="left"style="BORDER-BOTTOM: #cccccc 1px dashed"><img src="images/list_002.jpg" width="7" height="8" />&nbsp;&nbsp;<a href="news_info.asp?id=<%=rs("id")%>" target="_blank" title="<%=rs("new_name")%>"><%=left(rs("new_name"),28)%></a> </tr> <% count=count+1 rs.movenext loop end if %> </table> <table width="96%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="50" align="center">[<%=page%>/<b><%=rs.pagecount%></b>页] <%if page=1 then%> [首页][上一页] <%else%> [<a href="news.asp?page=1&amp;class_id=<%=typeid%>&big_id=<%=big_id%>">首页</a>][<a href="news.asp?page=<%=page-1%>&amp;class_id=<%=typeid%>&big_id=<%=big_id%>">上一页</a>] <%end if%> <%if pagenum-page<1 then%> [下一页][尾页] <%else%> [<a href="news.asp?page=<%=page+1%>&amp;class_id=<%=typeid%>&big_id=<%=big_id%>">下一页</a>][<a href="news.asp?page=<%=pagenum%>&amp;class_id=<%=typeid%>&big_id=<%=big_id%>">尾页</a>] <%end if%></td> </tr> </table></td> </tr> </table> </td> <td width="210" height="223" align="left888" valign="top"><!--#include file="left888.asp"--></td> </tr> </table> <!--#include file="bottom.asp" --> <% conn.close:set conn=nothing%> </body> </html>
1 下一页