ASP程序翻页问题
functionshowpage(totalnumber,maxperpage,filename)iftotalnumbermodmaxperpage=0thenn=to...
function showpage(totalnumber,maxperpage,filename)
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
%>
<form method=Post action="<%=filename%>?classid=<%=classid%>&Nclassid=<%=Nclassid%>">
<center>共有<b><%=totalnumber%></b>张专辑
<%if CurrentPage<2 then%>
首页 上一页
<%else%>
 <a href="<%=filename%>?page=1&classid=<%=classid%>&Nclassid=<%=Nclassid%>">首页</a>
<a href="<%=filename%>?page=<%=CurrentPage-1%>&classid=<%=classid%>&Nclassid=<%=Nclassid%>">上一页</a>
<%
end if
if n-currentpage<1 then
%>
下一页 末页
<%else%>
<a href="<%=filename%>?page=<%=CurrentPage+1%>&classid=<%=classid%>&Nclassid=<%=Nclassid%>">下一页</a>
<a href="<%=filename%>?page=<%=n%>&classid=<%=classid%>&Nclassid=<%=Nclassid%>">末页</a>
<%end if%>
页次:<strong><%=CurrentPage%>/<%=n%></strong>页
转到:<select name="page" size="1" onchange="javascript:submit()">
<%for i = 1 to n%>
<option value="<%=i%>" <%if cint(CurrentPage)=cint(i) then%> selected <%end if%>>第<%=i%>页</option>
<%next%>
</select>
</form>
<%end function%>
</td>
</tr>
</table>
</center>
</div>
最后那个转到第几页不管用,不管选第几页都会转到第一页 展开
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
%>
<form method=Post action="<%=filename%>?classid=<%=classid%>&Nclassid=<%=Nclassid%>">
<center>共有<b><%=totalnumber%></b>张专辑
<%if CurrentPage<2 then%>
首页 上一页
<%else%>
 <a href="<%=filename%>?page=1&classid=<%=classid%>&Nclassid=<%=Nclassid%>">首页</a>
<a href="<%=filename%>?page=<%=CurrentPage-1%>&classid=<%=classid%>&Nclassid=<%=Nclassid%>">上一页</a>
<%
end if
if n-currentpage<1 then
%>
下一页 末页
<%else%>
<a href="<%=filename%>?page=<%=CurrentPage+1%>&classid=<%=classid%>&Nclassid=<%=Nclassid%>">下一页</a>
<a href="<%=filename%>?page=<%=n%>&classid=<%=classid%>&Nclassid=<%=Nclassid%>">末页</a>
<%end if%>
页次:<strong><%=CurrentPage%>/<%=n%></strong>页
转到:<select name="page" size="1" onchange="javascript:submit()">
<%for i = 1 to n%>
<option value="<%=i%>" <%if cint(CurrentPage)=cint(i) then%> selected <%end if%>>第<%=i%>页</option>
<%next%>
</select>
</form>
<%end function%>
</td>
</tr>
</table>
</center>
</div>
最后那个转到第几页不管用,不管选第几页都会转到第一页 展开
2个回答
展开全部
你的转到这段改一下:
转到:<select name="page" size="1" onchange="javascript:document.forms[0].action+='&page='+this.value;submit()">
<%for i = 1 to n%>
<option value="<%=i%>" <%if cint(CurrentPage)=cint(i) then%> selected <%end if%>>第<%=i%>页</option>
<%next%>
</select>
转到:<select name="page" size="1" onchange="javascript:document.forms[0].action+='&page='+this.value;submit()">
<%for i = 1 to n%>
<option value="<%=i%>" <%if cint(CurrentPage)=cint(i) then%> selected <%end if%>>第<%=i%>页</option>
<%next%>
</select>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询