| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1910 人关注过本帖
标题:求助:如何在以下页面里增加分页显示,比如一页显示1题。一题一题的做下去。 ...
只看楼主 加入收藏
atian
Rank: 1
等 级:新手上路
帖 子:268
专家分:0
注 册:2006-1-24
结帖率:60%
收藏
 问题点数:0 回复次数:1 
求助:如何在以下页面里增加分页显示,比如一页显示1题。一题一题的做下去。
希望在学员姓名前面增加一个分页效果。Item=100   就是显示100题,但我希望一页显示一题,然后点下一页做第二题,再点下一页做第三题,至到第100题。交卷。

页面如下:

<%@ language="vbscript"%>
<%response.Expires = 0%>
<!--#include file="conn.asp"-->
<!--#include file="inc/Function.asp"-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www. lang="zh-CN">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="/css.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td> </td>
    </tr>
  </table>

  
<table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="360"><div align="center">  </div></td>
    <td width="360"><div align="center"> </div></td>
    <td width="360"><div align="center"> </div></td>
    <td width="360"><div align="center"> </div></td>
  </tr>
</table>
<table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td width="360"> </td>
    </tr>
  </table>
  <table width="980" border="0" align="center" cellpadding="5" cellspacing="0" class="table">
    <tr>
      <td bgcolor="FFF7D6" style="line-height:24px;color:#666666;">  </td>
    </tr>
    <tr>
      <td style="line-height:24px;color:#666666;"><font color="#0000FF">以下从题库中随机抽取!</font></td>
    </tr>
    <tr>
      <td valign="top" style="line-height:24px;color:#666666;"><table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
          <form name="form2" id="form2" method="post" action="jj.asp">
            <%
session("tiku")=""
call rsname(rs,"select * from [taobaoti]",1,1)
Count=rs.RecordCount            
Item=100   
redim a(Item, 2),t(Count)
for each j in t
    j=0
next
Randomize        
for j=1 to Item
    k=int(rnd*Count+1)   
    do while t(k)<>0                    
      k=int(rnd*Item+1)
    loop
    t(k)=1            
next
j=1:i=1
Do While Not rs.Eof
      if t(j)=1 then
          a(i,1)=rs("id")         
          a(i,2)=""
          i=i+1
     end if
j=j+1
rs.MoveNext
Loop
call closers()

for i=1 to Item
set rs=conn.execute("select * from [taobaoti] where id="&a(i,1)&"")
set temp=conn.execute("select top 4 * from [taobaoda] where tid="&a(i,1)&" order by mychar asc")
session("tiku")=session("tiku")&","&rs(0)
%>
            <tr bgcolor="f5f5f5">
              <td height="32" colspan="2"><strong style="font-size:14px;color:#111111;">&nbsp;<%=i%>、<%=rs("question")%> </strong>&nbsp;&nbsp;<a href="shiti.asp?id=<%=rs(0)%>" target="_blank" style="color:red;font-weight:bold;">查询答案</a>
              </td>
            </tr>
            <%do while not temp.eof%>
            <tr>
              <td width="4%" height="28"><div align="center">
                  <input type="radio" name="tid<%=rs(0)%>" value="<%=temp("mychar")%>" />
                </div></td>
              <td width="96%" style="font-size:14px;color:#222222;font-family:georgia;"><%=temp("mychar")%>&nbsp;&nbsp;<%=temp("answer")%></td>
            </tr>
            <%
            temp.movenext
            loop
            temp.close
            set temp=nothing%>
            <tr>
              <td colspan="2"><hr></td>
            </tr>
<%
next
call closers()
%>
            <tr>

              <td height="40" colspan="2">学员姓名:
                <input name="myname" type="text" id="myname" size="10" maxlength="10" /> </td>
            </tr>
            <tr>
              <td colspan="2"><input type="submit" name="Submit2" value="交卷" style="font-size:14px;width:90px;height:30px;" /></td>
            </tr>
          </form>
        </table></td>
    </tr>
  </table>

</body>
</html>
搜索更多相关主题的帖子: include PUBLIC title 如何 file 
2016-12-27 10:23
ke爱的小tu子
Rank: 2
等 级:论坛游民
帖 子:51
专家分:20
注 册:2021-2-11
收藏
得分:0 
单条数据分页吧。这个应该是asp很基本的能力了。
2021-02-11 14:32
快速回复:求助:如何在以下页面里增加分页显示,比如一页显示1题。一题一题的做 ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016146 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved