<% function WritePage(PageNumber) response.Write("<a href=message.asp?pagenumber=") response.Write(PageNumber) response.Write(">[") response.Write(pageNumber) response.Write("]</a>") end function
function ShowPageNumber(Total,NOV,current) if current-nov<=1 then for i = 1 to current - 1 WritePage(i) next response.Write(current) else response.Write("...") for i = current - nov to current - 1 WritePage(i) next response.Write(current) end if if total-current<=nov then for i = current + 1 to total writepage(i) next else for i = current + 1 to current + nov writepage(i) next response.Write("...") end if end function %>
<form action="showpagenumber.asp" method="post"> <input type="text" name="total" value="total"><br> <input type="text" name="nov" value="numberofvisable"><br> <input type="text" name="current" value="current"><br> <input type="submit" value="submit"> </form>
<% call showpagenumber(cint(request.Form("total")),cint(request.Form("nov")),cint(request.Form("current"))) %>
[此贴子已经被作者于2004-12-06 19:05:19编辑过]