'//分页导航
'//fileName:文件名/当前页面的话,可以留空
'//argString:分页参数例如classid=1&tid=16,分页必须的参数page不必填写
'//pindex:当前页码
'//datacount:总记录数
'//pages:总页数
'//showMsg:是否显示分页信息,参数为true/false
'//showText:是否显示首页、上页、下页、末页的导航,参数为true/false
'//showNumber:是否显示数字分页导航,参数为true/false
'public function pageLink(fileName,argString,pindex,datacount,pages,showMsg,showText,showNumber)
public function pageLink(fileName,argString,showMsg,showText,showNumber)
'//
if argString<>"" then argString = argString & "&"
if not showText and not showNumber then showText=true
'//
if showMsg then
Response.Write("[")
Response.Write("第 <span style='color:red;'>" & pindex & "</span> 页")
Response.Write("/分 <span style='color:red;'>" & pages & "</span> 页")
Response.Write("/总 <span style='color:red;'>" & datacount & "</span> 条记录")
Response.Write("] ")
end if
'//
if showText then
if pindex>1 then
Response.Write("<a href='" & fileName & "?" & argString & "page=1'>[首页]</a>")
Response.Write(" ")
Response.Write("<a href='" & fileName & "?" & argString & "page=" & pindex - 1 & "'>[上页]</a>")
else
Response.Write("[首页]")
Response.Write(" ")
Response.Write("[上页]")
end if
Response.Write(" ")
if pindex<pages then
Response.Write("<a href='" & fileName & "?" & argString & "page=" & pindex + 1 & "'>[下页]</a>")
Response.Write(" ")
Response.Write("<a href='" & fileName & "?" & argString & "page=" & pages & "'>[末页]</a>")
else
Response.Write("[下页]")
Response.Write(" ")
Response.Write("[末页]")
end if
end if
'//
if showNumber then
Response.Write(" ")
for i = 4 to 1 step -1
if (pindex - i)>0 then
Response.Write("<a href='" & fileName & "?" & argString & "page=" & pindex - i & "'>" & pindex - i & "</a>")
Response.Write(" ")
end if
next
'//
Response.Write("<span style='color:red;'>" & pindex & "</span>")
'//
for i = 1 to 4
if (pindex + i)<=pages then
Response.Write(" ")
Response.Write("<a href='" & fileName & "?" & argString & "page=" & pindex + i & "'>" & pindex + i & "</a>")
end if
next
'//
end if
'//
end function
%>
Word教程网 | Excel教程网 | Dreamweaver教程网 | Fireworks教程网 | PPT教程网 | FLASH教程网 | PS教程网 |
HTML教程网 | DIV CSS教程网 | FLASH AS教程网 | ACCESS教程网 | SQL SERVER教程网 | C语言教程网 | JAVASCRIPT教程网 |
ASP教程网 | ASP.NET教程网 | CorelDraw教程网 |