写了一个asp.net分页功能、点击下一页的时候失效。
我有两个QQ炫舞的角色,但是如果到了周六周日的话,有点券拿,我上了其中一个角色,但是在不同的区,另外的一个角色可以拿同样的点券吗??...
我有两个QQ炫舞的角色,但是如果到了周六周日的话,有点券拿,我上了其中一个角色,但是在不同的区,另外的一个角色可以拿同样的点券吗??
展开
1个回答
2011-05-06
展开全部
%
const MaxPerPage=10
'分页显示新闻个数
dim totalput,currentPage,TotalPages,typ,sql
typ=request.QueryString("type")
if typ<>"" then
if not isempty(request.querystring("num")) then
currentPage=cint(request.querystring("num"))
else
currentPage=1
end if
%>
<%
sql="select * from news where news_type="&typ&" order by news_time desc"
rs.open sql,conn,1,1
totalPut=rs.recordcount
if rs.eof then
response.write "<p align='center'> 没有相关新闻</p>"
else
if currentpage<1 then
currentpage=1
end if
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
showContent
showpages
end if
end if
if (currentPage-1)*MaxPerPage=totalPut then
rs.move (currentPage-1)*MaxPerPage
showContent
showpages
end if
%>
<%
sub showContent()
i=0
response.write "<div align=center><table width=100% border=0 cellspacing=0 cellpadding=0 > "
do while not rs.eof
response.write "<tr class=9p><td width=9% height=25 align=center valign=middle class=9red>★</td>"
dim url
if rs("news_jg")="1" then
url="news_detail1.asp?id=" & rs("id")
else
url="news_detail2.asp?id=" & rs("id")
end if
response.write " <td width=91% height=25 align=left valign=middle class=hand onClick=MM_openBrWindow('"&url&"','新闻','scrollbars=yes,resizable=yes,width=556,height=360')> "
if len(rs("news_title"))>20 then
response.write left(rs("news_title"),18)&".."&"<"&year(rs("news_time"))&"/"&month(rs("news_time"))&">"
else
response.write rs("news_title")&"<"&year(rs("news_time"))&"/"&month(rs("news_time"))&">"
end if
response.write "</td></tr>"
i=i+1
if i>=MaxPerPage then
exit do
else
rs.movenext
end if
loop
response.write"</td></tr></table></div>"
end sub %>
<%
sub showpages()
dim n
if (totalPut mod MaxPerPage)=0 then
n= totalPut \ MaxPerPage
else
n= totalPut \ MaxPerPage + 1
end if
if n=0 then
response.write "<p align='right'>本类没有新闻</p>"
exit sub
end if
dim k
response.write "<div align=center><br>分页 >> "
if currentPage<>n then
for k=1 to n
if k=currentPage then
response.write"["+Cstr(k)+"]"
else
response.write"<a href=show_newsmore.asp?num="&cstr(k)&"&type='"&trim(rs("news_type"))&"'>[" &Cstr(k)&" ]</a>"
end if
next
response.write "</div> "
else
response.write "最后一页"&"<a href='#'onclick=javascript:history.go(-1)> 返回</a> "
end if
end sub
%>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing %>
另外,站长团上有产品团购,便宜有保证
const MaxPerPage=10
'分页显示新闻个数
dim totalput,currentPage,TotalPages,typ,sql
typ=request.QueryString("type")
if typ<>"" then
if not isempty(request.querystring("num")) then
currentPage=cint(request.querystring("num"))
else
currentPage=1
end if
%>
<%
sql="select * from news where news_type="&typ&" order by news_time desc"
rs.open sql,conn,1,1
totalPut=rs.recordcount
if rs.eof then
response.write "<p align='center'> 没有相关新闻</p>"
else
if currentpage<1 then
currentpage=1
end if
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
showContent
showpages
end if
end if
if (currentPage-1)*MaxPerPage=totalPut then
rs.move (currentPage-1)*MaxPerPage
showContent
showpages
end if
%>
<%
sub showContent()
i=0
response.write "<div align=center><table width=100% border=0 cellspacing=0 cellpadding=0 > "
do while not rs.eof
response.write "<tr class=9p><td width=9% height=25 align=center valign=middle class=9red>★</td>"
dim url
if rs("news_jg")="1" then
url="news_detail1.asp?id=" & rs("id")
else
url="news_detail2.asp?id=" & rs("id")
end if
response.write " <td width=91% height=25 align=left valign=middle class=hand onClick=MM_openBrWindow('"&url&"','新闻','scrollbars=yes,resizable=yes,width=556,height=360')> "
if len(rs("news_title"))>20 then
response.write left(rs("news_title"),18)&".."&"<"&year(rs("news_time"))&"/"&month(rs("news_time"))&">"
else
response.write rs("news_title")&"<"&year(rs("news_time"))&"/"&month(rs("news_time"))&">"
end if
response.write "</td></tr>"
i=i+1
if i>=MaxPerPage then
exit do
else
rs.movenext
end if
loop
response.write"</td></tr></table></div>"
end sub %>
<%
sub showpages()
dim n
if (totalPut mod MaxPerPage)=0 then
n= totalPut \ MaxPerPage
else
n= totalPut \ MaxPerPage + 1
end if
if n=0 then
response.write "<p align='right'>本类没有新闻</p>"
exit sub
end if
dim k
response.write "<div align=center><br>分页 >> "
if currentPage<>n then
for k=1 to n
if k=currentPage then
response.write"["+Cstr(k)+"]"
else
response.write"<a href=show_newsmore.asp?num="&cstr(k)&"&type='"&trim(rs("news_type"))&"'>[" &Cstr(k)&" ]</a>"
end if
next
response.write "</div> "
else
response.write "最后一页"&"<a href='#'onclick=javascript:history.go(-1)> 返回</a> "
end if
end sub
%>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing %>
另外,站长团上有产品团购,便宜有保证
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
TableDI
2024-07-18 广告
2024-07-18 广告
在Excel中引用另一个工作簿表格的数据,可以通过以下步骤实现:1. 打开目标工作簿,选择需要填充数据的单元格。2. 输入“=”号,切换到要引用的工作簿。3. 选择需要引用的单元格或数据区域,注意使用正确的路径和文件名。4. 按下回车键,即...
点击进入详情页
本回答由TableDI提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询